diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js
index 86c7405..809c640 100644
--- a/htdocs/js/mpd.js
+++ b/htdocs/js/mpd.js
@@ -521,7 +521,7 @@ function parseQueue(obj) {
"
"+ obj.data[song].album +" | " +
""+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
" | | ";
- if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
+ if (nrItems <= tr.length) { if ($(tr[nrItems-1]).attr('trackid')!=obj.data[song].id) $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+app.current.app+'List > tbody').append(row); }
}
for (var i=tr.length;i>nrItems;i--) {
@@ -604,9 +604,11 @@ function parseFilesystem(obj) {
for (var item in obj.data) {
nrItems++;
var row='';
+ var uri='';
switch(obj.data[item].type) {
case 'directory':
- row ='' +
+ uri=encodeURI(obj.data[item].dir);
+ row ='
' +
'folder_open | ' +
'' + basename(obj.data[item].dir) + ' | ' +
' | |
';
@@ -614,7 +616,8 @@ function parseFilesystem(obj) {
case 'song':
var minutes = Math.floor(obj.data[item].duration / 60);
var seconds = obj.data[item].duration - minutes * 60;
- row ='' +
+ uri=encodeURI(obj.data[item].uri);
+ row ='
' +
'music_note | ' +
'' + obj.data[item].title + ' | ' +
'' + obj.data[item].artist + ' | ' +
@@ -623,13 +626,14 @@ function parseFilesystem(obj) {
' |
';
break;
case 'playlist':
- row ='' +
+ uri=encodeURI(obj.data[item].plist);
+ row ='
' +
'list | ' +
'' + basename(obj.data[item].plist) + ' | ' +
' | |
';
break;
}
- if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
+ if (nrItems <= tr.length) { if ($(tr[nrItems-1]).attr('uri') != uri) $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+app.current.app+(app.current.tab==undefined ? '' : app.current.tab)+'List > tbody').append(row); }
}
for (var i=tr.length;i>nrItems;i--) {
@@ -711,11 +715,12 @@ function parsePlaylists(obj) {
for (var item in obj.data) {
nrItems++;
var d = new Date(obj.data[item].last_modified * 1000);
- var row='' +
+ var uri=encodeURI(obj.data[item].plist);
+ var row='
' +
'list | ' +
'' + basename(obj.data[item].plist) + ' | ' +
''+d.toUTCString()+' | |
';
- if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
+ if (nrItems <= tr.length) { if ($(tr[nrItems-1]).attr('uri') != uri) $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+app.current.app+app.current.tab+'List > tbody').append(row); }
}
for (var i=tr.length;i>nrItems;i--) {
@@ -769,10 +774,11 @@ function parseListDBtags(obj) {
var tr=document.getElementById(app.current.app+app.current.tab+app.current.view+'List').getElementsByTagName('tbody')[0].getElementsByTagName('tr');
for (var item in obj.data) {
nrItems++;
- var row='' +
+ var uri=encodeURI(obj.data[item].value);
+ var row='
' +
'album | ' +
'' + obj.data[item].value + ' |
';
- if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
+ if (nrItems <= tr.length) { if ($(tr[nrItems-1]).attr('uri')!=uri) $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+app.current.app+app.current.tab+app.current.view+'List > tbody').append(row); }
}
@@ -967,7 +973,6 @@ function setLocalStream(mpdhost,streamport) {
mpdstream += mpdhost;
mpdstream += ':'+streamport+'/';
settings.mpdstream=mpdstream;
-// Cookies.set('mpdstream', mpdstream, { expires: 424242 });
}
function delQueueSong(tr,event) {