Preserve the protocol in Artist Image

Closes #4141
pull/4146/head
Bogdan 1 year ago
parent 6c34730796
commit 3a74029035

@ -7,13 +7,10 @@ function findImage(images, coverType) {
}
function getUrl(image, coverType, size) {
if (image) {
// Remove protocol
let url = image.url.replace(/^https?:/, '');
const imageUrl = image?.url;
url = url.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
return url;
if (imageUrl) {
return imageUrl.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
}
}

@ -10,12 +10,10 @@ function findLogo(images) {
}
function getLogoUrl(logo, size) {
if (logo) {
// Remove protocol
let url = logo.url.replace(/^https?:/, '');
url = url.replace('logo.jpg', `logo-${size}.jpg`);
const logoUrl = logo?.url;
return url;
if (logoUrl) {
return logoUrl.replace('logo.jpg', `logo-${size}.jpg`);
}
}

Loading…
Cancel
Save