From 3dd9d4c40e3b81beebbe7c0a66df93e226ac0bd1 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 4 Aug 2017 18:12:57 -0300 Subject: Change around some things in download-playlist --- src/playlist-utils.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/playlist-utils.js') 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 } -- cgit 1.3.0-6-gf8a5