mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Restore mergeServers condition
This commit is contained in:
parent
a9b439e458
commit
365240e17a
@ -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…
Reference in New Issue
Block a user