diff options
author | Liam <towerofnix@gmail.com> | 2017-07-16 09:06:04 -0400 |
---|---|---|
committer | Liam <towerofnix@gmail.com> | 2017-07-16 09:06:04 -0400 |
commit | 02059af9feea6326a76be2f5cf623d6ca86a4f78 (patch) | |
tree | b5b78856a237c2e097145320b078d590ab03e4bb /src | |
parent | d41eb1815c4c1614b0d3ecfdcda9eb41c20ea58d (diff) |
Fix top-level of locally crawled playlists to be a grouplike
Diffstat (limited to 'src')
-rwxr-xr-x | src/crawl-local.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crawl-local.js b/src/crawl-local.js index cf5db87..6d245ae 100755 --- a/src/crawl-local.js +++ b/src/crawl-local.js @@ -19,17 +19,15 @@ function crawl(dirPath) { return stat(itemPath).then(stats => { if (stats.isDirectory()) { - return crawl(itemPath).then(contents => { - const group = {name: item, items: contents} - return group - }) + return crawl(itemPath) + .then(group => Object.assign(group, {name: item})) } else if (stats.isFile()) { const track = {name: item, downloaderArg: itemPath} return track } }) })) - }) + }).then(items => ({items})) } if (process.argv.length === 2) { |