1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-04-11 11:42:19 +02:00

New: Add option to show tags on series Poster and Overview

Closes #6946
This commit is contained in:
Mark McDowall 2024-07-14 11:56:25 -07:00 committed by Mark McDowall
parent d3f14d5f5e
commit e35b39b4b1
12 changed files with 95 additions and 9 deletions

View File

@ -20,6 +20,7 @@ export interface SeriesIndexAppState {
showTitle: boolean; showTitle: boolean;
showMonitored: boolean; showMonitored: boolean;
showQualityProfile: boolean; showQualityProfile: boolean;
showTags: boolean;
showSearchAction: boolean; showSearchAction: boolean;
}; };
@ -34,6 +35,7 @@ export interface SeriesIndexAppState {
showSeasonCount: boolean; showSeasonCount: boolean;
showPath: boolean; showPath: boolean;
showSizeOnDisk: boolean; showSizeOnDisk: boolean;
showTags: boolean;
showSearchAction: boolean; showSearchAction: boolean;
}; };

View File

@ -55,6 +55,7 @@ function SeriesIndexOverviewOptionsModalContent(
showSeasonCount, showSeasonCount,
showPath, showPath,
showSizeOnDisk, showSizeOnDisk,
showTags,
showSearchAction, showSearchAction,
} = useSelector(selectOverviewOptions); } = useSelector(selectOverviewOptions);
@ -185,6 +186,17 @@ function SeriesIndexOverviewOptionsModalContent(
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>{translate('ShowTags')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showTags"
value={showTags}
onChange={onOverviewOptionChange}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel>{translate('ShowSearch')}</FormLabel> <FormLabel>{translate('ShowSearch')}</FormLabel>

View File

@ -73,14 +73,26 @@ $hoverScale: 1.05;
flex: 1 0 auto; flex: 1 0 auto;
} }
.overviewContainer {
display: flex;
justify-content: space-between;
flex: 0 1 1000px;
flex-direction: column;
}
.overview { .overview {
composes: link; composes: link;
flex: 0 1 1000px;
overflow: hidden; overflow: hidden;
min-height: 0; min-height: 0;
} }
.tags {
display: flex;
justify-content: space-around;
overflow: hidden;
}
@media only screen and (max-width: $breakpointSmall) { @media only screen and (max-width: $breakpointSmall) {
.overview { .overview {
display: none; display: none;

View File

@ -8,8 +8,10 @@ interface CssExports {
'info': string; 'info': string;
'link': string; 'link': string;
'overview': string; 'overview': string;
'overviewContainer': string;
'poster': string; 'poster': string;
'posterContainer': string; 'posterContainer': string;
'tags': string;
'title': string; 'title': string;
'titleRow': string; 'titleRow': string;
} }

View File

@ -5,6 +5,7 @@ import { REFRESH_SERIES, SERIES_SEARCH } from 'Commands/commandNames';
import IconButton from 'Components/Link/IconButton'; import IconButton from 'Components/Link/IconButton';
import Link from 'Components/Link/Link'; import Link from 'Components/Link/Link';
import SpinnerIconButton from 'Components/Link/SpinnerIconButton'; import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
import TagListConnector from 'Components/TagListConnector';
import { icons } from 'Helpers/Props'; import { icons } from 'Helpers/Props';
import DeleteSeriesModal from 'Series/Delete/DeleteSeriesModal'; import DeleteSeriesModal from 'Series/Delete/DeleteSeriesModal';
import EditSeriesModalConnector from 'Series/Edit/EditSeriesModalConnector'; import EditSeriesModalConnector from 'Series/Edit/EditSeriesModalConnector';
@ -70,6 +71,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
overview, overview,
statistics = {} as Statistics, statistics = {} as Statistics,
images, images,
tags,
network, network,
} = series; } = series;
@ -205,6 +207,7 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
</div> </div>
<div className={styles.details}> <div className={styles.details}>
<div className={styles.overviewContainer}>
<Link className={styles.overview} to={link}> <Link className={styles.overview} to={link}>
<TextTruncate <TextTruncate
line={Math.floor( line={Math.floor(
@ -214,6 +217,12 @@ function SeriesIndexOverview(props: SeriesIndexOverviewProps) {
/> />
</Link> </Link>
{overviewOptions.showTags ? (
<div className={styles.tags}>
<TagListConnector tags={tags} />
</div>
) : null}
</div>
<SeriesIndexOverviewInfo <SeriesIndexOverviewInfo
height={overviewHeight} height={overviewHeight}
monitored={monitored} monitored={monitored}

View File

@ -52,6 +52,7 @@ function SeriesIndexPosterOptionsModalContent(
showTitle, showTitle,
showMonitored, showMonitored,
showQualityProfile, showQualityProfile,
showTags,
showSearchAction, showSearchAction,
} = posterOptions; } = posterOptions;
@ -130,6 +131,18 @@ function SeriesIndexPosterOptionsModalContent(
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>{translate('ShowTags')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="showTags"
value={showTags}
helpText={translate('ShowTagsHelpText')}
onChange={onPosterOptionChange}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel>{translate('ShowSearch')}</FormLabel> <FormLabel>{translate('ShowSearch')}</FormLabel>

View File

@ -57,6 +57,20 @@ $hoverScale: 1.05;
font-size: $smallFontSize; font-size: $smallFontSize;
} }
.tags {
display: flex;
align-items: center;
justify-content: space-around;
padding: 0 3px;
height: 21px;
background-color: var(--seriesBackgroundColor);
}
.tagsList {
display: flex;
overflow: hidden;
}
.ended { .ended {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@ -10,6 +10,8 @@ interface CssExports {
'nextAiring': string; 'nextAiring': string;
'overlayTitle': string; 'overlayTitle': string;
'posterContainer': string; 'posterContainer': string;
'tags': string;
'tagsList': string;
'title': string; 'title': string;
} }
export const cssExports: CssExports; export const cssExports: CssExports;

View File

@ -5,6 +5,7 @@ import Label from 'Components/Label';
import IconButton from 'Components/Link/IconButton'; import IconButton from 'Components/Link/IconButton';
import Link from 'Components/Link/Link'; import Link from 'Components/Link/Link';
import SpinnerIconButton from 'Components/Link/SpinnerIconButton'; import SpinnerIconButton from 'Components/Link/SpinnerIconButton';
import TagListConnector from 'Components/TagListConnector';
import { icons } from 'Helpers/Props'; import { icons } from 'Helpers/Props';
import DeleteSeriesModal from 'Series/Delete/DeleteSeriesModal'; import DeleteSeriesModal from 'Series/Delete/DeleteSeriesModal';
import EditSeriesModalConnector from 'Series/Edit/EditSeriesModalConnector'; import EditSeriesModalConnector from 'Series/Edit/EditSeriesModalConnector';
@ -41,6 +42,7 @@ function SeriesIndexPoster(props: SeriesIndexPosterProps) {
showTitle, showTitle,
showMonitored, showMonitored,
showQualityProfile, showQualityProfile,
showTags,
showSearchAction, showSearchAction,
} = useSelector(selectPosterOptions); } = useSelector(selectPosterOptions);
@ -60,6 +62,7 @@ function SeriesIndexPoster(props: SeriesIndexPosterProps) {
added, added,
statistics = {} as Statistics, statistics = {} as Statistics,
images, images,
tags,
} = series; } = series;
const { const {
@ -208,6 +211,14 @@ function SeriesIndexPoster(props: SeriesIndexPosterProps) {
</div> </div>
) : null} ) : null}
{showTags && tags.length ? (
<div className={styles.tags}>
<div className={styles.tagsList}>
<TagListConnector tags={tags} />
</div>
</div>
) : null}
{nextAiring ? ( {nextAiring ? (
<div <div
className={styles.nextAiring} className={styles.nextAiring}

View File

@ -141,6 +141,7 @@ export default function SeriesIndexPosters(props: SeriesIndexPostersProps) {
showTitle, showTitle,
showMonitored, showMonitored,
showQualityProfile, showQualityProfile,
showTags,
} = posterOptions; } = posterOptions;
const nextAiringHeight = 19; const nextAiringHeight = 19;
@ -164,6 +165,10 @@ export default function SeriesIndexPosters(props: SeriesIndexPostersProps) {
heights.push(19); heights.push(19);
} }
if (showTags) {
heights.push(21);
}
switch (sortKey) { switch (sortKey) {
case 'network': case 'network':
case 'seasons': case 'seasons':

View File

@ -29,6 +29,7 @@ export const defaultState = {
showTitle: false, showTitle: false,
showMonitored: true, showMonitored: true,
showQualityProfile: true, showQualityProfile: true,
showTags: false,
showSearchAction: false showSearchAction: false
}, },
@ -43,6 +44,7 @@ export const defaultState = {
showSeasonCount: true, showSeasonCount: true,
showPath: false, showPath: false,
showSizeOnDisk: false, showSizeOnDisk: false,
showTags: false,
showSearchAction: false showSearchAction: false
}, },

View File

@ -1864,6 +1864,8 @@
"ShowSeasonCount": "Show Season Count", "ShowSeasonCount": "Show Season Count",
"ShowSeriesTitleHelpText": "Show series title under poster", "ShowSeriesTitleHelpText": "Show series title under poster",
"ShowSizeOnDisk": "Show Size on Disk", "ShowSizeOnDisk": "Show Size on Disk",
"ShowTags": "Show Tags",
"ShowTagsHelpText": "Show tags under poster",
"ShowTitle": "Show Title", "ShowTitle": "Show Title",
"ShowUnknownSeriesItems": "Show Unknown Series Items", "ShowUnknownSeriesItems": "Show Unknown Series Items",
"ShowUnknownSeriesItemsHelpText": "Show items without a series in the queue, this could include removed series, movies or anything else in {appName}'s category", "ShowUnknownSeriesItemsHelpText": "Show items without a series in the queue, this could include removed series, movies or anything else in {appName}'s category",