« get me outta code hell

make locally opened playlists have a group name! - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/smart-playlist.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2020-07-03 21:29:39 -0300
committerFlorrie <towerofnix@gmail.com>2020-07-03 21:29:39 -0300
commit3d73a0da45cc8e13b5ac0f58f57683ab2d772838 (patch)
treea03a62cc792c127a83592a48d040d65aeab0b21b /smart-playlist.js
parenta58f06407291824be882d896df58bace5e663196 (diff)
make locally opened playlists have a group name!
Diffstat (limited to 'smart-playlist.js')
-rw-r--r--smart-playlist.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/smart-playlist.js b/smart-playlist.js
index 09badd9..19294db 100644
--- a/smart-playlist.js
+++ b/smart-playlist.js
@@ -18,6 +18,12 @@ async function processSmartPlaylist(item, topItem = true) {
 
     if (crawl) {
       Object.assign(newItem, await crawl(...args))
+
+      // If the passed smart playlist had a name, retain that instead of using
+      // the name resulting from the crawler.
+      if (item.name) {
+        newItem.name = item.name
+      }
     } else {
       console.error(`No crawler by name ${name} - skipped item:`, item)
       newItem.failed = true