From cd713e7252f4e2be4c40def6eb654c75ee75f4ac Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 17 Jul 2024 17:41:40 +0300 Subject: [PATCH] New: Sort by tags on movie index --- .../src/Movie/Index/Menus/MovieIndexSortMenu.tsx | 9 +++++++++ .../src/Movie/Index/Posters/MovieIndexPoster.tsx | 4 +++- .../Movie/Index/Posters/MovieIndexPosterInfo.css | 8 ++++++++ .../Index/Posters/MovieIndexPosterInfo.css.d.ts | 2 ++ .../Movie/Index/Posters/MovieIndexPosterInfo.tsx | 15 +++++++++++++++ .../src/Movie/Index/Posters/MovieIndexPosters.tsx | 5 +++++ 6 files changed, 42 insertions(+), 1 deletion(-) diff --git a/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx b/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx index 98d85dceb..4d115e619 100644 --- a/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx +++ b/frontend/src/Movie/Index/Menus/MovieIndexSortMenu.tsx @@ -189,6 +189,15 @@ function MovieIndexSortMenu(props: MovieIndexSortMenuProps) { > {translate('OriginalLanguage')} + + + {translate('Tags')} + ); diff --git a/frontend/src/Movie/Index/Posters/MovieIndexPoster.tsx b/frontend/src/Movie/Index/Posters/MovieIndexPoster.tsx index 997293352..bc320e22a 100644 --- a/frontend/src/Movie/Index/Posters/MovieIndexPoster.tsx +++ b/frontend/src/Movie/Index/Posters/MovieIndexPoster.tsx @@ -82,7 +82,7 @@ function MovieIndexPoster(props: MovieIndexPosterProps) { certification, originalTitle, originalLanguage, - tags, + tags = [], } = movie; const { sizeOnDisk = 0 } = statistics; @@ -317,9 +317,11 @@ function MovieIndexPoster(props: MovieIndexPosterProps) { certification={certification} originalTitle={originalTitle} originalLanguage={originalLanguage} + tags={tags} showTmdbRating={showTmdbRating} showImdbRating={showImdbRating} showRottenTomatoesRating={showRottenTomatoesRating} + showTags={showTags} /> +
+ +
+ + ); + } + if (sortKey === 'path') { return (
diff --git a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx index 97710003c..ac14a8bfa 100644 --- a/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx +++ b/frontend/src/Movie/Index/Posters/MovieIndexPosters.tsx @@ -237,6 +237,11 @@ export default function MovieIndexPosters(props: MovieIndexPostersProps) { heights.push(19); } break; + case 'tags': + if (!showTags) { + heights.push(21); + } + break; default: // No need to add a height of 0 }