From 3d73a0da45cc8e13b5ac0f58f57683ab2d772838 Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 3 Jul 2020 21:29:39 -0300 Subject: make locally opened playlists have a group name! --- client.js | 1 - crawlers.js | 5 ++++- smart-playlist.js | 6 ++++++ todo.txt | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 0f7dde3..33cc62a 100644 --- a/client.js +++ b/client.js @@ -63,7 +63,6 @@ const setupClient = async ({backend, writable, interfacer, appConfig}) => { cleanTerminal() }) - // TODO: Don't load a default playlist? let grouplike = { name: 'My ~/Music Library', comment: ( diff --git a/crawlers.js b/crawlers.js index 92243c9..1cbb036 100644 --- a/crawlers.js +++ b/crawlers.js @@ -298,7 +298,10 @@ function crawlLocal(dirPath, extensions = [ throw err } }).then(items => items.filter(Boolean)) - .then(filteredItems => ({items: filteredItems})) + .then(filteredItems => ({ + name: path.basename(dirPath), + items: filteredItems + })) } crawlLocal.crawlerName = 'crawl-local' 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 diff --git a/todo.txt b/todo.txt index 8bfc682..98a57a8 100644 --- a/todo.txt +++ b/todo.txt @@ -521,3 +521,21 @@ TODO: In that regard, also change the queue length label (just above the time label) to indicate which track is selected --- RELATIVE to the current track, ala "40 (+5) / 1032" or "5 (-1) / 10". (Done!) + +TODO: Deselecting a grouplike listing (e.g. by clicking elsewhere) should hide + its "jump to" element. + +TODO: A "before selected item" option for in the queue menu! + +TODO: The sorting for library3/C418 seems to be weird???? Could be pointing to + some bug! + +TODO: Selecting a group from the path listing at the bottom of listings should + make it so the child of that group matching with the path is selected. + For example: selecting X in W/X/Y/Z would open the directory X and + select item Y; selecting Z would open the directory Z and select the + track (or group) which the path element is active on in the first place. + +TODO: UI to change the directory from which mtui reads music by default! + +TODO: file/folder browse-select UI 0_0 -- cgit 1.3.0-6-gf8a5