« get me outta code hell

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:
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