1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix image loading

This commit is contained in:
Luke Pulverenti 2015-06-16 00:52:01 -04:00
parent 46776f1eac
commit 0d59297b1b
86 changed files with 5857 additions and 273 deletions

View file

@ -992,10 +992,17 @@
getPostersPerRow: function (screenWidth) {
var cache = true;
function getValue(shape) {
var div = $('<div class="card ' + shape + 'Card"><div class="cardBox"><div class="cardImage"></div></div></div>').appendTo(document.body);
var width = screenWidth / $('.cardImage', div).innerWidth();
var innerWidth = $('.cardImage', div).innerWidth();
if (!innerWidth || isNaN(innerWidth)) {
cache = false;
innerWidth = Math.min(400, screenWidth / 2);
}
var width = screenWidth / innerWidth;
div.remove();
return Math.floor(width);
}
@ -1006,6 +1013,7 @@
var currentShape = LibraryBrowser.shapes[i];
info[currentShape] = getValue(currentShape);
}
info.cache = cache;
return info;
},
@ -1025,8 +1033,11 @@
}
var result = LibraryBrowser.getPosterViewInfoInternal(screenWidth);
result.screenWidth = screenWidth;
cachedResults.push(result);
if (result.cache) {
cachedResults.push(result);
}
return result;
},
@ -1039,7 +1050,7 @@
result.screenWidth = screenWidth;
if (!AppInfo.hasLowImageBandwidth) {
screenWidth *= 1.25;
screenWidth *= 1.2;
}
var roundTo = 100;
@ -1057,6 +1068,8 @@
result[currentShape + 'Width'] = Math.round(shapeWidth);
}
result.cache = imagesPerRow.cache;
return result;
},
@ -1785,7 +1798,7 @@
throw new Error("null item passed into getPosterViewDisplayName");
}
var name = item.EpisodeTitle || item.Name;
var name = item.EpisodeTitle || item.Name || '';
if (item.Type == "TvChannel") {