Skip to content

Commit 3fd6c37

Browse files
committed
remove files not in the paths
1 parent ba98a0e commit 3fd6c37

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ MusicLibrary.prototype.clean = function (opts, cb) {
141141
var batcher = byteStream({time: opts.time || 200, limit: opts.limit || 100})
142142
var levelBatch = new LevelBatch(this.db)
143143
var paralleLevelBatch = parallel(levelBatch, opts.parallel || 10)
144-
145144
var paths = this.paths
146145

147146
function operation (chunk) {
@@ -153,7 +152,7 @@ MusicLibrary.prototype.clean = function (opts, cb) {
153152
}
154153

155154
function fsStat (chunk, enc, cb) {
156-
if (!paths.some(areIncluded)) {
155+
if (!paths.some(inPaths)) {
157156
this.push(chunk)
158157
return cb()
159158
}
@@ -164,8 +163,8 @@ MusicLibrary.prototype.clean = function (opts, cb) {
164163
return cb()
165164
}
166165

167-
function areIncluded (path) {
168-
return path === chunk.value.root
166+
function inPaths (path) {
167+
return chunk.value.root === path
169168
}
170169
}
171170

0 commit comments

Comments
 (0)