Cleaning up playlist context menus

This commit is contained in:
James Barnsley
2019-02-19 16:41:44 +13:00
parent 5aaf72f852
commit b59d710261
9 changed files with 2293 additions and 2986 deletions

View File

@ -1514,7 +1514,7 @@ const MopidyMiddleware = (function(){
for (var i = 0; i < playlist_uris_filtered.length; i++){
request(socket, store, 'playlists.lookup', { uri: playlist_uris_filtered[i] })
.then(response => {
var source = helpers.uriSource(response.uri)
var source = helpers.uriSource(response.uri);
var playlist = Object.assign(
{},
{
@ -1522,7 +1522,7 @@ const MopidyMiddleware = (function(){
name: response.name,
uri: response.uri,
source: source,
is_mopidy: true,
provider: 'mopidy',
last_modified: response.last_modified,
tracks_total: (response.tracks ? response.tracks.length : 0 )
}
@ -1582,9 +1582,9 @@ const MopidyMiddleware = (function(){
var trackReferences = tracks.filter(getByURI);
// there could be multiple instances of this track, so accommodate this
for(var j = 0; j < trackReferences.length; j++){
var key = tracks.indexOf(trackReferences[j] );
tracks[ key ] = track;
for (var j = 0; j < trackReferences.length; j++){
var key = tracks.indexOf(trackReferences[j]);
tracks[key] = track;
}
}
}
@ -2064,7 +2064,7 @@ const MopidyMiddleware = (function(){
{},
(response ? response[0].artists[0] : {}),
{
is_mopidy: true,
provider: 'mopidy',
albums_uris: helpers.arrayOf('uri',albums),
tracks: response
}
@ -2096,7 +2096,7 @@ const MopidyMiddleware = (function(){
{},
(response ? response[uri][0].artists[0] : {}),
{
is_mopidy: true
provider: 'mopidy'
}
);
artists.push(artist);

View File

@ -250,6 +250,7 @@ const SpotifyMiddleware = (function(){
playlist,
{
uri: playlist.uri.replace(/spotify:user:([^:]*?):/i, "spotify:"),
can_edit: (store.getState().spotify.me && store.getState().spotify.me.id == playlist.owner.id),
source: 'spotify',
in_library: true, // assumed because we asked for library items
tracks_total: playlist.tracks.total