Check Exist before Rendering Posters/Banners

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

@ -11,12 +11,14 @@ 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;
} }
}
} }
class ArtistBanner extends Component { class ArtistBanner extends Component {

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

Loading…
Cancel
Save