Check Exist before Rendering Posters/Banners

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

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

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

Loading…
Cancel
Save