Preserve the protocol for fanart images

Closes #2944
This commit is contained in:
Bogdan
2023-10-01 17:29:46 +03:00
parent e28becdda4
commit b001ecd698
2 changed files with 2 additions and 12 deletions

View File

@@ -25,12 +25,7 @@ const defaultFontSize = parseInt(fonts.defaultFontSize);
const lineHeight = parseFloat(fonts.lineHeight);
function getFanartUrl(images) {
const fanartImage = images.find((x) => x.coverType === 'fanart');
if (fanartImage) {
// Remove protocol
return fanartImage.url.replace(/^https?:/, '');
}
return images.find((x) => x.coverType === 'fanart')?.url;
}
class AuthorDetailsHeader extends Component {

View File

@@ -21,12 +21,7 @@ const defaultFontSize = parseInt(fonts.defaultFontSize);
const lineHeight = parseFloat(fonts.lineHeight);
function getFanartUrl(images) {
const fanartImage = images.find((x) => x.coverType === 'fanart');
if (fanartImage) {
// Remove protocol
return fanartImage.url.replace(/^https?:/, '');
}
return images.find((x) => x.coverType === 'fanart')?.url;
}
class BookDetailsHeader extends Component {