mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update hdhr stream
This commit is contained in:
parent
d1f8d6afc2
commit
d808aced1d
5 changed files with 61 additions and 21 deletions
48
dashboard-ui/bower_components/emby-webcomponents/servernotifications.js
vendored
Normal file
48
dashboard-ui/bower_components/emby-webcomponents/servernotifications.js
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
define(['connectionManager', 'events'], function (connectionManager, events) {
|
||||
|
||||
var serverNotifications = {};
|
||||
|
||||
function onWebSocketMessageReceived(e, msg) {
|
||||
|
||||
var apiClient = this;
|
||||
|
||||
if (msg.MessageType === "LibraryChanged") {
|
||||
}
|
||||
else if (msg.MessageType === "ServerShuttingDown") {
|
||||
events.trigger(serverNotifications, 'ServerShuttingDown', [apiClient]);
|
||||
}
|
||||
else if (msg.MessageType === "ServerRestarting") {
|
||||
events.trigger(serverNotifications, 'ServerRestarting', [apiClient]);
|
||||
}
|
||||
else if (msg.MessageType === "RestartRequired") {
|
||||
events.trigger(serverNotifications, 'RestartRequired', [apiClient]);
|
||||
}
|
||||
else if (msg.MessageType === "UserDataChanged") {
|
||||
|
||||
if (msg.Data.UserId == apiClient.getCurrentUserId()) {
|
||||
|
||||
for (var i = 0, length = msg.Data.UserDataList.length; i < length; i++) {
|
||||
events.trigger(serverNotifications, 'UserDataChanged', [apiClient, msg.Data.UserDataList[i]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bindEvents(apiClient) {
|
||||
|
||||
events.off(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||
events.on(apiClient, "websocketmessage", onWebSocketMessageReceived);
|
||||
}
|
||||
|
||||
//var current = connectionManager.currentApiClient();
|
||||
//if (current) {
|
||||
// bindEvents(current);
|
||||
//}
|
||||
|
||||
events.on(connectionManager, 'apiclientcreated', function (e, newApiClient) {
|
||||
|
||||
bindEvents(newApiClient);
|
||||
});
|
||||
|
||||
return serverNotifications;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue