Resolving track overwrite issue; Repairing queue images; Next is formatImages()

This commit is contained in:
James Barnsley
2018-09-08 21:16:18 +12:00
parent b7914e6c66
commit 1114b9031f
8 changed files with 10688 additions and 14008 deletions

View File

@ -1759,13 +1759,13 @@ const MopidyMiddleware = (function(){
var artists_uris = [];
for (var artist in response[uri][0].artists){
artists_loaded.push(helpers.formatArtist(artist));
artists_loaded.push(artist);
artists_uris.push(artist.uri);
}
var tracks_uris = [];
for (var track in response[uri]){
tracks_loaded.push(helpers.formatTrack(track));
tracks_loaded.push(helpers.track);
tracks_uris.push(track.uri);
}
@ -1811,7 +1811,7 @@ const MopidyMiddleware = (function(){
var artists = [];
for (var artist of response[0].artists){
artists.push(helpers.formatArtist(artist));
artists.push(artist);
}
var album = Object.assign(
@ -1819,7 +1819,7 @@ const MopidyMiddleware = (function(){
{
images: []
},
helpers.formatAlbum(response[0].album),
response[0].album,
{
source: 'local',
artists_uris: helpers.arrayOf('uri', artists),
@ -2073,8 +2073,8 @@ const MopidyMiddleware = (function(){
case 'MOPIDY_CURRENT_TRACK_LOADED':
var track = helpers.formatTrack(action.tl_track);
// We don't have the track already in our index
if (!store.getState().core.tracks[track.uri]){
// We don't have the track already in our index, or we do but it's a partial record
if (store.getState().core.tracks[track.uri] === undefined || store.getState().core.tracks[track.uri].images === undefined){
// We've got Spotify running, and it's a spotify track - go straight to the source!
if (store.getState().spotify.enabled && helpers.uriSource(track.uri) == 'spotify'){