From c3425f516dfabe15c71b37faa9fa27ec55612900 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 13 May 2023 18:09:51 -0300 Subject: skip .DS_Store, .git in crawl-local --- crawlers.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crawlers.js b/crawlers.js index b2f13fd..8197095 100644 --- a/crawlers.js +++ b/crawlers.js @@ -16,6 +16,11 @@ export const musicExtensions = [ 'mod' ] +export const skipNames = [ + '.DS_Store', + '.git', +] + // Each value is a function with these additional properties: // * crawlerName: The name of the crawler, such as "crawl-http". Used by // getCrawlerByName. @@ -251,6 +256,12 @@ function crawlLocal(dirPath, extensions = musicExtensions, isTop = true) { items = orderBy(items) return Promise.all(items.map(item => { + // There are a few files which are just never what we're looking for. + // We skip including or searching under these altogether. + if (skipNames.includes(item)) { + return null + } + const itemPath = path.join(dirPath, item) const itemURL = url.pathToFileURL(itemPath).href -- cgit 1.3.0-6-gf8a5