further optimized caching, and minor bugfix

This commit is contained in:
R. Aidan Campbell 2016-09-03 18:12:34 -04:00
parent bfea4dbf5f
commit b94e7cd0c2
2 changed files with 6 additions and 1 deletions

View File

@ -319,7 +319,6 @@ function unpairClicked(host) {
$('#continueUnpairHost').on('click', function () {
host.unpair().then(function (onSuccess) {
var unpairHostDialog = document.querySelector('#unpairHostDialog');
unpairHostDialog.close();
$('#host-container-' + host.serverUid).remove();
snackbarLog('Successfully unpaired from host');
delete hosts[host.serverUid]; // remove the host from the array;

View File

@ -294,7 +294,13 @@ NvHTTP.prototype = {
return this.getAppListWithCacheFlush();
},
// warms `this` _memCachedBoxArtArray with ALL box art from ALL servers
// this is inefficient, but works well.
warmBoxArtCache: function () {
if (!this.paired) {
console.log('not warming box art cache from unpaired host.');
return;
}
if (Object.keys(this._memCachedBoxArtArray).length != 0) {
console.log('box art cache already warmed.');
return;