mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
SignalR added to provide realtime episode status updates. (Series/Details and Downloading only currently)
This commit is contained in:
parent
ac84d76ef9
commit
f19721912b
19 changed files with 1871 additions and 1156 deletions
|
@ -62,4 +62,36 @@ function redrawGrid() {
|
|||
//Force reload using Ajax Binding (bServerSide == false)
|
||||
function reloadGrid() {
|
||||
oTable.fnReloadAjax();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//SignalR
|
||||
$(function () {
|
||||
// Proxy created on the fly
|
||||
var signalRProvider = $.connection.signalRProvider;
|
||||
|
||||
// Declare a function on the chat hub so the server can invoke it
|
||||
signalRProvider.updatedStatus = function (episodeId, episodeStatus) {
|
||||
var imageSrc = '../../Content/Images/' + episodeStatus + '.png';
|
||||
var row = $('tr.episodeId_' + episodeId);
|
||||
|
||||
if (row.length == 0)
|
||||
return;
|
||||
|
||||
var statusImage = $(row).find('img.statusImage');
|
||||
|
||||
if (statusImage.length == 0)
|
||||
return;
|
||||
|
||||
statusImage.attr('alt', episodeStatus);
|
||||
statusImage.attr('title', episodeStatus);
|
||||
statusImage.attr('src', imageSrc);
|
||||
|
||||
if (episodeStatus != "Missing") {
|
||||
statusImage.parent('td').removeClass('episodeMissing');
|
||||
}
|
||||
};
|
||||
|
||||
// Start the connection
|
||||
$.connection.hub.start();
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue