1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fixes #513 - Fix flickering on dashboard now playing page

This commit is contained in:
Luke Pulverenti 2013-09-03 11:40:47 -04:00
parent 3431c8544e
commit 44c1876907

View file

@ -86,7 +86,7 @@
var rowId = 'trSession' + connection.Id;
var elem = $('#' + rowId, page);
if (elem.length) {
DashboardPage.updateSession(elem, connection);
continue;
@ -126,18 +126,27 @@
$('.deadSession', table).remove();
},
updateSession: function(row, session) {
updateSession: function (row, session) {
row.removeClass('deadSession');
$('.username', row).html(session.UserName || '');
var nowPlayingItem = session.NowPlayingItem;
$('.nowPlayingText', row).html(DashboardPage.getNowPlayingText(session, nowPlayingItem)).trigger('create');
$('.nowPlayingImage', row).html(DashboardPage.getNowPlayingImage(nowPlayingItem));
var imageRow = $('.nowPlayingImage', row);
var image = $('img', imageRow)[0];
var nowPlayingItemId = nowPlayingItem ? nowPlayingItem.Id : null;
var nowPlayingItemImageTag = nowPlayingItem ? nowPlayingItem.PrimaryImageTag : null;
if (!image || image.getAttribute('data-itemid') != nowPlayingItemId || image.getAttribute('data-tag') != nowPlayingItemImageTag) {
imageRow.html(DashboardPage.getNowPlayingImage(nowPlayingItem));
}
},
getClientType: function (connection) {
@ -217,7 +226,9 @@
tag: item.PrimaryImageTag
});
return "<img class='clientNowPlayingImage' src='" + url + "' alt='" + item.Name + "' title='" + item.Name + "' />";
url += "&xxx=" + new Date().getTime();
return "<img data-itemid='" + item.Id + "' data-tag='" + item.PrimaryImageTag + "' class='clientNowPlayingImage' src='" + url + "' alt='" + item.Name + "' title='" + item.Name + "' />";
}
return "";