From 8c1eb084c9b6e34d688838fcc878540510bc61a8 Mon Sep 17 00:00:00 2001 From: Nicholas Villarreal Date: Thu, 4 Apr 2019 09:14:37 -0600 Subject: [PATCH] feat: Add soundcloud support to GenerateMetadata (#398) --- lib/helpers.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/helpers.js b/lib/helpers.js index 1cb378a..f632d2b 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -192,6 +192,26 @@ Helpers.GenerateMetadata = function (uri, title = '', region = '3079') { .replace('##SPOTIFYTYPE##', 'object.container.playlistContainer') .replace('##PARENTID##', '') } + } else if (uri.startsWith('x-rincon-cpcontainer:100d206cuser-fav')) { // Sound Cloud likes + const id = uri.replace('x-rincon-cpcontainer:', '') + return { + uri: uri, + metadata: meta.replace('##SPOTIFYURI##', id) + .replace('##RESOURCETITLE##', title || 'Sound Cloud Likes') + .replace('##SPOTIFYTYPE##', 'object.container.albumList') + .replace('##PARENTID##', '') + .replace(`SA_RINCON${region}_X_#Svc${region}-0-Token`, 'SA_RINCON40967_X_#Svc40967-0-Token') + } + } else if (uri.startsWith('x-rincon-cpcontainer:1006206cplaylist')) { // Sound Cloud playlists + const [id] = uri.replace('x-rincon-cpcontainer:', '').split('?') + return { + uri: uri, + metadata: meta.replace('##SPOTIFYURI##', id) + .replace('##RESOURCETITLE##', title || 'Sound Cloud Playlist') + .replace('##SPOTIFYTYPE##', 'object.container.playlistContainer') + .replace('##PARENTID##', '') + .replace(`SA_RINCON${region}_X_#Svc${region}-0-Token`, 'SA_RINCON40967_X_#Svc40967-0-Token') + } } else { return { uri: uri, metadata: '' } }