« get me outta code hell

Merge branch 'master' of https://github.com/liam4/http-music - http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
path: root/src/playlist-utils.js
diff options
context:
space:
mode:
authorFlorrie <towerofni@gmail.com>2017-08-03 03:20:23 +0400
committerFlorrie <towerofni@gmail.com>2017-08-03 03:20:23 +0400
commit63ee18f61991cfcd10e42871d57eccd53fa51828 (patch)
treeb07bbe3aa8b4358a77758783638b447465a850fe /src/playlist-utils.js
parentb94845e008931bfaee56b91db1f892af7a6d339f (diff)
parent70462b74635da8eb92c10d51d1a8a1fe06ceb9f1 (diff)
Merge branch 'master' of https://github.com/liam4/http-music
Diffstat (limited to 'src/playlist-utils.js')
-rw-r--r--src/playlist-utils.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/playlist-utils.js b/src/playlist-utils.js
index 55638ed..5efd478 100644
--- a/src/playlist-utils.js
+++ b/src/playlist-utils.js
@@ -56,6 +56,16 @@ function updateGroupFormat(group) {
     // isn't a string..
     if (typeof item[1] === 'string' || item.downloaderArg) {
       item = updateTrackFormat(item)
+
+      // TODO: Should this also apply to groups? Is recursion good? Probably
+      // not!
+      //
+      // TODO: How should saving/serializing handle this? For now it just saves
+      // the result, after applying. (I.e., "apply": {"foo": "baz"} will save
+      // child tracks with {"foo": "baz"}.)
+      if (groupObj.apply) {
+        Object.assign(item, groupObj.apply)
+      }
     } else {
       item = updateGroupFormat(item)
     }