diff options
author | Florrie <towerofnix@gmail.com> | 2017-08-04 23:01:31 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2017-08-04 23:01:37 -0300 |
commit | 2df2b68db50b363f37ab715199e43720f9345dd1 (patch) | |
tree | a2e9029993a91c65d333fa62a71f67cf1f4eb895 /src | |
parent | 3dd9d4c40e3b81beebbe7c0a66df93e226ac0bd1 (diff) |
Remove extension from found track names in crawl-local
Diffstat (limited to 'src')
-rwxr-xr-x | src/crawl-local.js | 7 |
1 files changed, 6 insertions, 1 deletions
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 |