update components

This commit is contained in:
Luke Pulverenti 2016-03-14 01:04:42 -04:00
parent 50a27ba0b4
commit ed63dd2039
7 changed files with 18 additions and 73 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.0.43",
"_release": "1.0.43",
"version": "1.0.44",
"_release": "1.0.44",
"_resolution": {
"type": "version",
"tag": "1.0.43",
"commit": "5c5aeb79353f3a7d3e20a456d6f1506d660f8626"
"tag": "1.0.44",
"commit": "31d79dade27d28bad1c45ad30da03550493c17ca"
},
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "~1.0.3",

View file

@ -308,9 +308,6 @@
var existingServer = existingServers.length ? existingServers[0] : {};
existingServer.DateLastAccessed = new Date().getTime();
existingServer.LastConnectionMode = ConnectionMode.Manual;
if (existingServer.LastConnectionMode == ConnectionMode.Local) {
existingServer.DateLastLocalConnection = new Date().getTime();
}
existingServer.ManualAddress = apiClient.serverAddress();
apiClient.serverInfo(existingServer);
@ -412,10 +409,6 @@
if (options.updateDateLastAccessed !== false) {
server.DateLastAccessed = new Date().getTime();
if (server.LastConnectionMode == ConnectionMode.Local) {
server.DateLastLocalConnection = new Date().getTime();
}
}
server.Id = result.ServerId;
@ -869,8 +862,7 @@
var info = {
Id: foundServer.Id,
LocalAddress: convertEndpointAddressToManualAddress(foundServer) || foundServer.Address,
Name: foundServer.Name,
DateLastLocalConnection: new Date().getTime()
Name: foundServer.Name
};
info.LastConnectionMode = info.ManualAddress ? ConnectionMode.Manual : ConnectionMode.Local;
@ -1165,10 +1157,6 @@
if (options.updateDateLastAccessed !== false) {
server.DateLastAccessed = new Date().getTime();
if (connectionMode == ConnectionMode.Local) {
server.DateLastLocalConnection = new Date().getTime();
}
}
credentialProvider.addOrUpdateServer(credentials.Servers, server);
credentialProvider.credentials(credentials);
@ -1517,33 +1505,7 @@
});
}
return self.getAvailableServers().then(function (servers) {
var currentServerId = apiClient.serverInfo().Id;
var matchedServers = servers.filter(function (s) {
return stringEqualsIgnoreCase(s.Id, currentServerId);
});
var match = matchedServers.length ? matchedServers[0] : null;
var dateLastLocalConnection = match ? match.DateLastLocalConnection : null;
if (!dateLastLocalConnection) {
return apiClient.getJSON(apiClient.getUrl('System/Endpoint')).then(function (info) {
if (info.IsInNetwork) {
updateDateLastLocalConnection(currentServerId);
return apiClient.getRegistrationInfo(feature);
} else {
return {};
}
});
} else {
return apiClient.getRegistrationInfo(feature);
}
});
return apiClient.getRegistrationInfo(feature);
};
function isConnectUserSupporter() {
@ -1559,22 +1521,6 @@
return false;
}
function updateDateLastLocalConnection(serverId) {
var credentials = credentialProvider.credentials();
var servers = credentials.Servers.filter(function (s) {
return s.Id == serverId;
});
var server = servers.length ? servers[0] : null;
if (server) {
server.DateLastLocalConnection = new Date().getTime();
credentialProvider.addOrUpdateServer(credentials.Servers, server);
credentialProvider.credentials(credentials);
}
}
function addAppInfoToConnectRequest(request) {
request.headers = request.headers || {};
request.headers['X-Application'] = appName + '/' + appVersion;

View file

@ -95,7 +95,6 @@
if (server.ConnectServerId) {
existing.ConnectServerId = server.ConnectServerId;
}
existing.DateLastLocalConnection = Math.max(existing.DateLastLocalConnection || 0, server.DateLastLocalConnection || 0);
return existing;
}