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

#762 - Marking unwatched doesn't update display

This commit is contained in:
Luke Pulverenti 2014-06-30 14:55:38 -04:00
parent 08567dd844
commit 190377babb
3 changed files with 58 additions and 16 deletions

View file

@ -320,7 +320,7 @@
Dashboard.showLoadingMsg();
$.ajax({
type: "POST",
url: ApiClient.getUrl("Videos/MergeVersions", { Ids: selection.join(',') })
@ -335,9 +335,9 @@
}
});
}
function addToCollection(page) {
var selection = getSelectedItems(page);
if (selection.length < 1) {
@ -377,4 +377,48 @@
});
function renderUserDataChanges(posterItem, userData) {
if (userData.Played) {
if (!$('.playedIndicator', posterItem).length) {
var html = '<div class="unplayedIndicator"><div class="ui-icon-check ui-btn-icon-notext"></div></div>';
$(html).insertAfter($('.posterItemOverlayTarget', posterItem));
}
} else {
$('.playedIndicator', posterItem).remove();
}
// TODO: Handle progress bar
// $('.posterItemProgressContainer').remove();
}
function onUserDataChanged(userData) {
$('.posterItemUserData' + userData.Key).each(function () {
renderUserDataChanges(this, userData);
});
}
function onWebSocketMessage(e, data) {
var msg = data;
if (msg.MessageType === "UserDataChanged") {
if (msg.Data.UserId == Dashboard.getCurrentUserId()) {
for (var i = 0, length = msg.Data.UserDataList.length; i < length; i++) {
onUserDataChanged(msg.Data.UserDataList[i]);
}
}
}
}
$(ApiClient).on('websocketmessage', onWebSocketMessage);
})(jQuery, document, window);