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) { function getUrl(image, coverType, size) {
if (image) { const imageUrl = image?.url;
// Remove protocol
let url = image.url.replace(/^https?:/, '');
url = url.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`); if (imageUrl) {
return imageUrl.replace(`${coverType}.jpg`, `${coverType}-${size}.jpg`);
return url;
} }
} }

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

Loading…
Cancel
Save