New: Sort by tags on movie index

pull/10105/head
Bogdan 4 months ago
parent a54f54eb6e
commit cd713e7252

@ -189,6 +189,15 @@ function MovieIndexSortMenu(props: MovieIndexSortMenuProps) {
> >
{translate('OriginalLanguage')} {translate('OriginalLanguage')}
</SortMenuItem> </SortMenuItem>
<SortMenuItem
name="tags"
sortKey={sortKey}
sortDirection={sortDirection}
onPress={onSortSelect}
>
{translate('Tags')}
</SortMenuItem>
</MenuContent> </MenuContent>
</SortMenu> </SortMenu>
); );

@ -82,7 +82,7 @@ function MovieIndexPoster(props: MovieIndexPosterProps) {
certification, certification,
originalTitle, originalTitle,
originalLanguage, originalLanguage,
tags, tags = [],
} = movie; } = movie;
const { sizeOnDisk = 0 } = statistics; const { sizeOnDisk = 0 } = statistics;
@ -317,9 +317,11 @@ function MovieIndexPoster(props: MovieIndexPosterProps) {
certification={certification} certification={certification}
originalTitle={originalTitle} originalTitle={originalTitle}
originalLanguage={originalLanguage} originalLanguage={originalLanguage}
tags={tags}
showTmdbRating={showTmdbRating} showTmdbRating={showTmdbRating}
showImdbRating={showImdbRating} showImdbRating={showImdbRating}
showRottenTomatoesRating={showRottenTomatoesRating} showRottenTomatoesRating={showRottenTomatoesRating}
showTags={showTags}
/> />
<EditMovieModalConnector <EditMovieModalConnector

@ -9,3 +9,11 @@
composes: info; composes: info;
} }
.tags {
composes: tags from '~./MovieIndexPoster.css';
}
.tagsList {
composes: tagsList from '~./MovieIndexPoster.css';
}

@ -2,6 +2,8 @@
// Please do not change this file! // Please do not change this file!
interface CssExports { interface CssExports {
'info': string; 'info': string;
'tags': string;
'tagsList': string;
'title': string; 'title': string;
} }
export const cssExports: CssExports; export const cssExports: CssExports;

@ -2,6 +2,7 @@ import React from 'react';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
import ImdbRating from 'Components/ImdbRating'; import ImdbRating from 'Components/ImdbRating';
import RottenTomatoRating from 'Components/RottenTomatoRating'; import RottenTomatoRating from 'Components/RottenTomatoRating';
import TagListConnector from 'Components/TagListConnector';
import TmdbRating from 'Components/TmdbRating'; import TmdbRating from 'Components/TmdbRating';
import { icons } from 'Helpers/Props'; import { icons } from 'Helpers/Props';
import Language from 'Language/Language'; import Language from 'Language/Language';
@ -28,6 +29,7 @@ interface MovieIndexPosterInfoProps {
originalTitle: string; originalTitle: string;
originalLanguage: Language; originalLanguage: Language;
sizeOnDisk?: number; sizeOnDisk?: number;
tags: number[];
sortKey: string; sortKey: string;
showRelativeDates: boolean; showRelativeDates: boolean;
showCinemaRelease: boolean; showCinemaRelease: boolean;
@ -38,6 +40,7 @@ interface MovieIndexPosterInfoProps {
showTmdbRating: boolean; showTmdbRating: boolean;
showImdbRating: boolean; showImdbRating: boolean;
showRottenTomatoesRating: boolean; showRottenTomatoesRating: boolean;
showTags: boolean;
} }
function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) { function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) {
@ -56,6 +59,7 @@ function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) {
originalTitle, originalTitle,
originalLanguage, originalLanguage,
sizeOnDisk, sizeOnDisk,
tags = [],
sortKey, sortKey,
showRelativeDates, showRelativeDates,
showCinemaRelease, showCinemaRelease,
@ -66,6 +70,7 @@ function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) {
showTmdbRating, showTmdbRating,
showImdbRating, showImdbRating,
showRottenTomatoesRating, showRottenTomatoesRating,
showTags,
} = props; } = props;
if (sortKey === 'studio' && studio) { if (sortKey === 'studio' && studio) {
@ -199,6 +204,16 @@ function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) {
); );
} }
if (!showTags && sortKey === 'tags' && tags.length) {
return (
<div className={styles.tags}>
<div className={styles.tagsList}>
<TagListConnector tags={tags} />
</div>
</div>
);
}
if (sortKey === 'path') { if (sortKey === 'path') {
return ( return (
<div className={styles.info} title={translate('Path')}> <div className={styles.info} title={translate('Path')}>

@ -237,6 +237,11 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) {
heights.push(19); heights.push(19);
} }
break; break;
case 'tags':
if (!showTags) {
heights.push(21);
}
break;
default: default:
// No need to add a height of 0 // No need to add a height of 0
} }

Loading…
Cancel
Save