diff options
author | (quasar) nebula <towerofnix@gmail.com> | 2021-08-14 00:11:39 -0300 |
---|---|---|
committer | (quasar) nebula <towerofnix@gmail.com> | 2021-08-14 00:12:07 -0300 |
commit | c047b8c57d4e5012578c072420d2b73dd5b59c4c (patch) | |
tree | 52270b0895d4bb61790aff43856ff4e3d2e78982 /crawlers.js | |
parent | 9c7e30f90f0e30535f87fbb28222c9a40940d9ec (diff) |
handy combine-album.js utility
this isn't exposed via the mtui command so like, just run it directly with node right now lol (this commit also makes "." parse in timestamp positions)
Diffstat (limited to 'crawlers.js')
-rw-r--r-- | crawlers.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawlers.js b/crawlers.js index 3f6e391..6af615d 100644 --- a/crawlers.js +++ b/crawlers.js @@ -11,6 +11,15 @@ const { promisify } = require('util') const readDir = promisify(fs.readdir) const stat = promisify(fs.stat) +const musicExtensions = [ + 'ogg', 'oga', + 'wav', 'mp3', 'm4a', 'aac', 'flac', 'opus', + 'mp4', 'mov', 'mkv', + 'mod' +] + +module.exports.musicExtensions = musicExtensions + // Each value is a function with these additional properties: // * crawlerName: The name of the crawler, such as "crawl-http". Used by // getCrawlerByName. @@ -229,12 +238,7 @@ function getHTMLLinks(text) { } */ -function crawlLocal(dirPath, extensions = [ - 'ogg', 'oga', - 'wav', 'mp3', 'm4a', 'aac', 'flac', 'opus', - 'mp4', 'mov', 'mkv', - 'mod' -], isTop = true) { +function crawlLocal(dirPath, extensions = musicExtensions, isTop = true) { // If the passed path is a file:// URL, try to decode it: try { const url = new URL(dirPath) |