diff options
author | Florrie <towerofnix@gmail.com> | 2017-08-04 18:12:57 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2017-08-04 18:13:13 -0300 |
commit | 3dd9d4c40e3b81beebbe7c0a66df93e226ac0bd1 (patch) | |
tree | 7e3778d2877f872b4d8ae36924bbf6e8b5723aaf /src/playlist-utils.js | |
parent | 9dce2bac1a4d6e8e5f1a37edfa92e2d9c1b7d0e7 (diff) |
Change around some things in download-playlist
Diffstat (limited to 'src/playlist-utils.js')
-rw-r--r-- | src/playlist-utils.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/playlist-utils.js b/src/playlist-utils.js index 5efd478..aed4964 100644 --- a/src/playlist-utils.js +++ b/src/playlist-utils.js @@ -245,6 +245,14 @@ function getPlaylistTreeString(playlist, showTracks = false) { return recursive(playlist) } +function getItemPath(item) { + if (item[parentSymbol]) { + return [...getItemPath(item[parentSymbol]), item] + } else { + return [item] + } +} + function getItemPathString(item) { // Gets the playlist path of an item by following its parent chain. // Returns a string in format Foo/Bar/Baz, where Foo and Bar are group @@ -286,7 +294,7 @@ module.exports = { filterPlaylistByPathString, filterGrouplikeByPath, removeGroupByPathString, removeGroupByPath, getPlaylistTreeString, - getItemPathString, + getItemPath, getItemPathString, parsePathString, isGroup, isTrack } |