Skip to content
Snippets Groups Projects
Commit 8e5184a8 authored by Robin Appelman's avatar Robin Appelman
Browse files

correctly save the playlist if songs are removed and dont load the player...

correctly save the playlist if songs are removed and dont load the player outisde the media app if the playlist is empty
parent a84b00ce
Branches
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ $(document).ready(function() {
}
if(typeof PlayList==='undefined'){
if(typeof localStorage !== 'undefined'){
if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_items')){
if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_items' && localStorage.getItem(oc_current_user+'oc_playlist_items')!='[]'){
loadPlayer();
}
}
......
......@@ -142,6 +142,7 @@ var PlayList={
remove:function(index){
PlayList.items.splice(index,1);
PlayList.render();
PlayList.save();
},
render:function(){},
playing:function(){
......@@ -160,6 +161,7 @@ var PlayList={
if(typeof localStorage !== 'undefined'){
if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_items')){
PlayList.items=JSON.parse(localStorage.getItem(oc_current_user+'oc_playlist_items'));
if(PlayList.items.length>0){
PlayList.current=parseInt(localStorage.getItem(oc_current_user+'oc_playlist_current'));
var time=parseInt(localStorage.getItem(oc_current_user+'oc_playlist_time'));
if(localStorage.hasOwnProperty(oc_current_user+'oc_playlist_volume')){
......@@ -182,3 +184,4 @@ var PlayList={
}
}
}
}
......@@ -135,6 +135,7 @@ function procesSelection(){
});
PlayList.items=PlayList.items.filter(function(item){return item!==null});
PlayList.render();
PlayList.save();
procesSelection();
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment