From 36332b26b37f3c611d991e83ec5b17ab2a8af082 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 23 Dec 2018 00:01:23 -0400 Subject: Show "unnamed" in "this group:" (and its menu) --- ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui.js b/ui.js index dfb75ae..f5880df 100644 --- a/ui.js +++ b/ui.js @@ -254,7 +254,7 @@ class AppElement extends FocusElement { items: [ // A label that just shows some brief information about the item. isGroup && {label: - `("${item.name}" -` + + `(${item.name ? `"${item.name}"` : 'Unnamed'} -` + ` ${item.items.length} item${item.items.length === 1 ? '' : 's'}` + `, ${countTotalItems(item)} total` + ')'}, @@ -976,7 +976,7 @@ class GrouplikeListingElement extends Form { // within any groups (so you can't bworse a parent and access its menu // from there). if (!this.grouplike.isTheQueue) { - const ownElement = new BasicGrouplikeItemElement(`This group: ${this.grouplike.name}`) + const ownElement = new BasicGrouplikeItemElement(`This group: ${this.grouplike.name || '(Unnamed group)'}`) ownElement.item = this.grouplike ownElement.recordStore = this.recordStore ownElement.isGroup = true -- cgit 1.3.0-6-gf8a5 From 770f7ce6f89f7cfc0d1f8f5d279a0649caa1a45a Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 23 Dec 2018 00:06:31 -0400 Subject: Fix typo in keybindings section of README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5071468..c59f80b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ You're also welcome to share any ideas, suggestions, and questions through there * Escape - stop playing the current track * Right - seek ahead * Left - seek back -* Ctrl+O - jump to a track or group by entering (part of) its name +* Ctrl+F or / - jump to a track or group by entering (part of) its name * Ctrl+O - open a playlist from a source (like a /path/to/a/folder or a YouTube playlist URL) (you can also just pass this source to `mtui`) * t and T (shift+T) - switch between playlist tabs * Ctrl+T - open the current playlist in a new tab (so, clone the current tab) -- cgit 1.3.0-6-gf8a5 From b0f256ea0352fd86f40c6e4bd18bee47c36c320b Mon Sep 17 00:00:00 2001 From: Florrie Date: Sat, 22 Dec 2018 13:45:33 -0400 Subject: HTTP crawler stuff Basically, support for cors-anywhere. (Cherry-picked from web-mtui branch) --- crawlers.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crawlers.js b/crawlers.js index feeedf2..c12948f 100644 --- a/crawlers.js +++ b/crawlers.js @@ -86,7 +86,15 @@ function crawlHTTP(absURL, opts = {}, internals = {}) { name = name.trim() - const urlObj = new url.URL(href, absURL + '/') + let base + if (path.extname(absURL)) { + base = path.dirname(absURL) + '/' + console.log('extname:', path.extname(absURL), 'so base:', base) + } else { + base = absURL + } + + const urlObj = new url.URL(href, base) const linkURL = url.format(urlObj) if (internals.allURLs.includes(linkURL)) { @@ -115,9 +123,9 @@ function crawlHTTP(absURL, opts = {}, internals = {}) { break sameDir } - const relative = path.relative(absURLObj.pathname, urlObj.pathname) + const relative = path.relative((new url.URL(base)).pathname, urlObj.pathname) if (relative.startsWith('..') || path.isAbsolute(relative)) { - verboseLog("[Ignored] Outside of parent directory: " + linkURL) + verboseLog("[Ignored] Outside of parent directory: " + linkURL + "\n-- relative: " + relative + "\n-- to base: " + base) continue } } -- cgit 1.3.0-6-gf8a5