mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Restore mergeServers condition
This commit is contained in:
parent
a9b439e458
commit
365240e17a
1 changed files with 9 additions and 0 deletions
|
@ -37,6 +37,14 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
|||
});
|
||||
}
|
||||
|
||||
function mergeServers(credentialProvider, list1, list2) {
|
||||
for (var i = 0, length = list2.length; i < length; i++) {
|
||||
credentialProvider.addOrUpdateServer(list1, list2[i]);
|
||||
}
|
||||
|
||||
return list1;
|
||||
}
|
||||
|
||||
function updateServerInfo(server, systemInfo) {
|
||||
server.Name = systemInfo.ServerName;
|
||||
if (systemInfo.Id) {
|
||||
|
@ -636,6 +644,7 @@ define(["events", "apiclient", "appStorage"], function (events, apiClientFactory
|
|||
return Promise.all([findServers()]).then(function (responses) {
|
||||
var foundServers = responses[0];
|
||||
var servers = credentials.Servers.slice(0);
|
||||
mergeServers(credentialProvider, servers, foundServers);
|
||||
servers.sort(function (a, b) {
|
||||
return (b.DateLastAccessed || 0) - (a.DateLastAccessed || 0);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue