From 02059af9feea6326a76be2f5cf623d6ca86a4f78 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 16 Jul 2017 09:06:04 -0400 Subject: Fix top-level of locally crawled playlists to be a grouplike --- src/crawl-local.js | 8 +++----- 1 file 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) { -- cgit 1.3.0-6-gf8a5