From 2df2b68db50b363f37ab715199e43720f9345dd1 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 4 Aug 2017 23:01:31 -0300 Subject: Remove extension from found track names in crawl-local --- src/crawl-local.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/crawl-local.js b/src/crawl-local.js index 134a574..202c732 100755 --- a/src/crawl-local.js +++ b/src/crawl-local.js @@ -33,7 +33,12 @@ function crawl(dirPath, extensions = [ const ext = path.extname(item).slice(1) if (extensions.includes(ext)) { - const track = {name: item, downloaderArg: itemPath} + // The name of the track doesn't include the file extension; a user + // probably wouldn't add the file extensions to a hand-written + // playlist, or want them in an auto-generated one. + const basename = path.basename(item, path.extname(item)) + + const track = {name: basename, downloaderArg: itemPath} return track } else { return null -- cgit 1.3.0-6-gf8a5