mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-03-05 13:20:20 -05:00
@@ -136,6 +136,7 @@ function AddNewSeriesModalContent({
|
||||
className={styles.poster}
|
||||
images={images}
|
||||
size={250}
|
||||
title={title}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -74,6 +74,7 @@ function AddNewSeriesSearchResult({ series }: AddNewSeriesSearchResultProps) {
|
||||
size={250}
|
||||
overflow={true}
|
||||
lazy={false}
|
||||
title={title}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ function SeriesSearchResult(props: SeriesSearchResultProps) {
|
||||
size={250}
|
||||
lazy={false}
|
||||
overflow={true}
|
||||
title={title}
|
||||
/>
|
||||
|
||||
<div className={styles.titles}>
|
||||
|
||||
@@ -526,6 +526,7 @@ function SeriesDetails({ seriesId }: SeriesDetailsProps) {
|
||||
images={images}
|
||||
size={500}
|
||||
lazy={false}
|
||||
title={title}
|
||||
/>
|
||||
|
||||
<div className={styles.info}>
|
||||
|
||||
@@ -171,6 +171,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
|
||||
size={250}
|
||||
lazy={false}
|
||||
overflow={true}
|
||||
title={title}
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -183,6 +183,7 @@ function SeriesIndexPoster(props: SeriesIndexPosterProps) {
|
||||
size={250}
|
||||
lazy={false}
|
||||
overflow={true}
|
||||
title={title}
|
||||
onError={onPosterLoadError}
|
||||
onLoad={onPosterLoad}
|
||||
/>
|
||||
|
||||
@@ -198,6 +198,7 @@ function SeriesIndexRow(props: SeriesIndexRowProps) {
|
||||
images={images}
|
||||
lazy={false}
|
||||
overflow={true}
|
||||
title={title}
|
||||
onError={onBannerLoadError}
|
||||
onLoad={onBannerLoad}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from 'react';
|
||||
import LazyLoad from 'react-lazyload';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import { CoverType, Image } from './Series';
|
||||
|
||||
function findImage(images: Image[], coverType: CoverType) {
|
||||
@@ -23,6 +30,7 @@ export interface SeriesImageProps {
|
||||
size?: number;
|
||||
lazy?: boolean;
|
||||
overflow?: boolean;
|
||||
title: string;
|
||||
onError?: () => void;
|
||||
onLoad?: () => void;
|
||||
}
|
||||
@@ -38,6 +46,7 @@ function SeriesImage({
|
||||
size = 250,
|
||||
lazy = true,
|
||||
overflow = false,
|
||||
title,
|
||||
onError,
|
||||
onLoad,
|
||||
}: SeriesImageProps) {
|
||||
@@ -46,6 +55,26 @@ function SeriesImage({
|
||||
const [isLoaded, setIsLoaded] = useState(true);
|
||||
const image = useRef<Image | null>(null);
|
||||
|
||||
const alt = useMemo(() => {
|
||||
let type = translate('ImagePoster');
|
||||
|
||||
switch (coverType) {
|
||||
case 'banner':
|
||||
type = translate('Banner');
|
||||
break;
|
||||
case 'fanart':
|
||||
type = translate('ImageFanart');
|
||||
break;
|
||||
case 'season':
|
||||
type = translate('ImageSeason');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return `${title} ${type}`;
|
||||
}, [title, coverType]);
|
||||
|
||||
const handleLoad = useCallback(() => {
|
||||
setHasError(false);
|
||||
setIsLoaded(true);
|
||||
@@ -103,6 +132,7 @@ function SeriesImage({
|
||||
}
|
||||
>
|
||||
<img
|
||||
alt={alt}
|
||||
className={className}
|
||||
style={style}
|
||||
src={url}
|
||||
@@ -116,6 +146,7 @@ function SeriesImage({
|
||||
|
||||
return (
|
||||
<img
|
||||
alt={alt}
|
||||
className={className}
|
||||
style={style}
|
||||
src={isLoaded ? url : placeholder}
|
||||
|
||||
@@ -842,7 +842,11 @@
|
||||
"IgnoreDownloadsHint": "Stops {appName} from processing these downloads further",
|
||||
"Ignored": "Ignored",
|
||||
"IgnoredAddresses": "Ignored Addresses",
|
||||
"ImageBanner": "banner",
|
||||
"ImageFanart": "fanart",
|
||||
"ImagePoster": "poster",
|
||||
"Images": "Images",
|
||||
"ImageSeason": "season",
|
||||
"ImdbId": "IMDb ID",
|
||||
"Implementation": "Implementation",
|
||||
"Import": "Import",
|
||||
|
||||
Reference in New Issue
Block a user