Deleting correct song on error

This commit is contained in:
Kasper Rynning-Tønnesen
2017-05-14 13:13:04 +02:00
parent 54d33022b3
commit c8cc177bbe
3 changed files with 10 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -355,14 +355,19 @@ var List = {
} }
setTimeout(function() setTimeout(function()
{ {
if(!removed) $("#"+deleted).remove(); if(!removed){
$("#"+deleted).remove();
full_playlist.splice(List.getIndexOfSong(deleted), 1); full_playlist.splice(List.getIndexOfSong(deleted), 1);
}
if(chromecastAvailable){ if(chromecastAvailable){
Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id}); Player.sendNext({title: full_playlist[0].title, videoId: full_playlist[0].id});
} }
}, 305); }, 305);
if(removed) $("#"+deleted).remove(); if(removed) {
$("#"+deleted).remove();
full_playlist.splice(List.getIndexOfSong(deleted), 1);
}
} catch(err) { } catch(err) {
full_playlist.splice(List.getIndexOfSong(deleted), 1); full_playlist.splice(List.getIndexOfSong(deleted), 1);