From ad6b3d5d5a19ccdf3cf42082b5b6b2673413209f Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Sun, 10 Mar 2024 01:45:03 +0100 Subject: [PATCH] Add Subidy and WebM3U support * Display the playlists provided by the Mopidy-Subidy and Mopidy-WebM3U extensions in addition to the ones provided by the built-in M3U plugin. * Show artists and albums from the Mopidy-Subidy backend (served by a Subsonic server). --- src/js/util/helpers.js | 8 ++++++-- src/js/util/selectors.js | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/js/util/helpers.js b/src/js/util/helpers.js index cf1d916f1..ec092f31a 100755 --- a/src/js/util/helpers.js +++ b/src/js/util/helpers.js @@ -140,8 +140,10 @@ const uriType = function (uri) { if (!uri) return ''; const exploded = `${uri}`.split(':'); + const is_playlist_uri = exploded.length >= 1 && exploded[1] === 'playlist' - if (exploded[0] === 'm3u') { + // The following covers m3u, webm3u, subidy:playlist URI schemes. + if (exploded[0].endsWith('m3u') || is_playlist_uri) { return 'playlist'; } @@ -193,8 +195,10 @@ const sourceIcon = function (uri, source = null) { if (uri) source = uriSource(uri); switch (source) { case 'local': - case 'm3u': case 'file': + case 'm3u': + case 'webm3u': + case 'subidy': return 'folder'; case 'gmusic': diff --git a/src/js/util/selectors.js b/src/js/util/selectors.js index f6528a1a2..7075129b2 100755 --- a/src/js/util/selectors.js +++ b/src/js/util/selectors.js @@ -107,6 +107,16 @@ const providers = { uri: 'm3u:playlists', title: i18n('services.mopidy.local'), }, + { + scheme: 'webm3u:', + uri: 'webm3u:playlists', + title: i18n('services.webm3u.title'), + }, + { + scheme: 'subidy:', + uri: 'subidy:playlists', + title: i18n('services.subidy.title'), + }, { scheme: 'spotify:', uri: 'spotify:library:playlists', @@ -134,6 +144,11 @@ const providers = { setting_name: 'library_albums_uri', title: i18n('services.mopidy.local'), }, + { + scheme: 'subidy:', + uri: 'subidy:vdir:albums', + title: i18n('services.subidy.title'), + }, { scheme: 'gmusic:', uri: 'gmusic:album', @@ -166,6 +181,11 @@ const providers = { setting_name: 'library_artists_uri', title: i18n('services.mopidy.local'), }, + { + scheme: 'subidy:', + uri: 'subidy:vdir:artists', + title: i18n('services.subidy.title'), + }, { scheme: 'gmusic:', uri: 'gmusic:artist',