Skip to content

Commit

Permalink
Support Subidy and WebM3U playlist providers
Browse files Browse the repository at this point in the history
Display the playlists provided by the Mopidy-Subidy and Mopidy-WebM3U extensions in addition to the ones provided by the built-in M3U plugin.
  • Loading branch information
mgoltzsche committed Mar 14, 2024
1 parent 62c4e06 commit 6e260c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/util/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down Expand Up @@ -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':
Expand Down
10 changes: 10 additions & 0 deletions src/js/util/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6e260c7

Please sign in to comment.