From 95eaf0a3d66e0fd9c7793e8ac4d451236c2d791d Mon Sep 17 00:00:00 2001 From: krateng Date: Wed, 23 Nov 2022 23:40:44 +0100 Subject: [PATCH] Added interface for picking services to scrobbler --- .../maloja-scrobbler/settings.html | 8 +++- .../maloja-scrobbler/settings.js | 47 ++++++++++++++++++- dev/releases/3.1.yml | 4 ++ .../predefined/krateng_artistsingroups.tsv | 1 + 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.html b/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.html index da9baa8..11b3a8f 100644 --- a/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.html +++ b/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.html @@ -14,7 +14,7 @@ color:beige; font-family:'Ubuntu'; } - input { + input[type=text] { width:270px; font-family:'Ubuntu'; outline:none; @@ -33,10 +33,14 @@

API key:
-

+
Tabs: +
+ Services: + + diff --git a/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.js b/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.js index 68ce4aa..3ebf833 100644 --- a/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.js +++ b/auxiliary/chromium_scrobbler/maloja-scrobbler/settings.js @@ -1,11 +1,45 @@ +// duplicate this info for now, don't know if there is a better way than sending messages +var pages = { + "plex":"Plex", + "ytmusic":"YouTube Music", + "spotify":"Spotify", + "bandcamp":"Bandcamp", + "soundcloud":"Soundcloud", + "navidrome":"Navidrome" +} + var config_defaults = { serverurl:"http://localhost:42010", apikey:"BlackPinkInYourArea" } +for (var key in pages) { + config_defaults["service_active_" + key] = true; +} + document.addEventListener("DOMContentLoaded",function() { + var sitelist = document.getElementById("sitelist"); + + + for (var identifier in pages) { + sitelist.append(document.createElement('br')); + var checkbox = document.createElement('input'); + checkbox.type = "checkbox"; + checkbox.id = "service_active_" + identifier; + var label = document.createElement('label'); + label.for = checkbox.id; + label.textContent = pages[identifier]; + sitelist.appendChild(checkbox); + sitelist.appendChild(label); + + checkbox.addEventListener("change",toggleSite); + + } + + + document.getElementById("serverurl").addEventListener("change",checkServer); document.getElementById("apikey").addEventListener("change",checkServer); @@ -20,7 +54,13 @@ document.addEventListener("DOMContentLoaded",function() { chrome.storage.local.get(config_defaults,function(result){ for (var key in result) { - document.getElementById(key).value = result[key]; + if (result[key] == true || result[key] == false) { + document.getElementById(key).checked = result[key]; + } + else{ + document.getElementById(key).value = result[key]; + } + } checkServer(); }) @@ -31,6 +71,11 @@ document.addEventListener("DOMContentLoaded",function() { }); +function toggleSite(evt) { + var element = evt.target; + chrome.storage.local.set({ [element.id]: element.checked }); +} + function onInternalMessage(request,sender) { if (request.type == "response") { diff --git a/dev/releases/3.1.yml b/dev/releases/3.1.yml index d3cea79..c90d9a1 100644 --- a/dev/releases/3.1.yml +++ b/dev/releases/3.1.yml @@ -33,3 +33,7 @@ minor_release_name: "Soyeon" - "[Feature] Expanded information saved from Listenbrainz API" - "[Feature] Added import for Listenbrainz exports" - "[Bugfix] Sanitized artists and tracks with html-like structure" +3.1.5: + notes: + - "[Feature] Made image upload part of regular API" + - "[Bugfix] Additional entity name sanitization" diff --git a/maloja/data_files/config/rules/predefined/krateng_artistsingroups.tsv b/maloja/data_files/config/rules/predefined/krateng_artistsingroups.tsv index ca2fec0..590f8c9 100644 --- a/maloja/data_files/config/rules/predefined/krateng_artistsingroups.tsv +++ b/maloja/data_files/config/rules/predefined/krateng_artistsingroups.tsv @@ -22,3 +22,4 @@ countas Gawr Gura Hololive EN countas Mori Calliope Hololive EN countas Ninomae Ina'nis Hololive EN countas Takanashi Kiara Hololive EN +countas Ceres Fauna Hololive EN