Skip to content

Commit

Permalink
feat: Add soundcloud support to GenerateMetadata (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Villarreal authored and bencevans committed Apr 4, 2019
1 parent 1d54c48 commit 8c1eb08
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '' }
}
Expand Down

0 comments on commit 8c1eb08

Please sign in to comment.