Check Exist before Rendering Posters/Banners

pull/110/head
Qstick 7 years ago
parent 13bfb73ee9
commit 90018cf487

@ -11,11 +11,13 @@ function findBanner(images) {
function getBannerUrl(banner, size) {
if (banner) {
if (banner.url.contains('lastWrite')) {
// Remove protocol
let url = banner.url.replace(/^https?:/, '');
url = url.replace('banner.jpg', `banner-${size}.jpg`);
let url = banner.url.replace(/^https?:/, '');
url = url.replace('banner.jpg', `banner-${size}.jpg`);
return url;
return url;
}
}
}

@ -11,11 +11,13 @@ function findPoster(images) {
function getPosterUrl(poster, size) {
if (poster) {
// Remove protocol
let url = poster.url.replace(/^https?:/, '');
url = url.replace('poster.jpg', `poster-${size}.jpg`);
if (poster.url.contains('lastWrite')) {
// Remove protocol
let url = poster.url.replace(/^https?:/, '');
url = url.replace('poster.jpg', `poster-${size}.jpg`);
return url;
return url;
}
}
}

Loading…
Cancel
Save