Preserve the protocol for fanart images

(cherry picked from commit d8633b968830fd20d73612e9f0d0559b0bcb304c)

Closes #4145
pull/4155/head
Bogdan 1 year ago
parent 6e479235cb
commit 44add0d884

@ -39,11 +39,7 @@ const intermediateFontSize = parseInt(fonts.intermediateFontSize);
const lineHeight = parseFloat(fonts.lineHeight); const lineHeight = parseFloat(fonts.lineHeight);
function getFanartUrl(images) { function getFanartUrl(images) {
const fanartImage = _.find(images, { coverType: 'fanart' }); return _.find(images, { coverType: 'fanart' })?.url;
if (fanartImage) {
// Remove protocol
return fanartImage.url.replace(/^https?:/, '');
}
} }
function formatDuration(timeSpan) { function formatDuration(timeSpan) {

@ -44,11 +44,7 @@ const defaultFontSize = parseInt(fonts.defaultFontSize);
const lineHeight = parseFloat(fonts.lineHeight); const lineHeight = parseFloat(fonts.lineHeight);
function getFanartUrl(images) { function getFanartUrl(images) {
const fanartImage = _.find(images, { coverType: 'fanart' }); return _.find(images, { coverType: 'fanart' })?.url;
if (fanartImage) {
// Remove protocol
return fanartImage.url.replace(/^https?:/, '');
}
} }
function getExpandedState(newState) { function getExpandedState(newState) {

Loading…
Cancel
Save