From 239202d9c11f27410b0fa084bcc4c824b7136081 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Sun, 7 Mar 2021 18:06:50 -0500 Subject: [PATCH] fix(ui): list all movie studios instead of just the first result (#1110) --- src/components/MovieDetails/index.tsx | 25 +++++++++++++++---------- src/components/TvDetails/index.tsx | 6 ++++-- src/i18n/locale/en.json | 4 ++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index c0049f8d..9d898815 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -64,7 +64,7 @@ const messages = defineMessages({ If this item exists in your Plex library, the media information will be recreated during the next scan.', approve: 'Approve', decline: 'Decline', - studio: 'Studio', + studio: '{studioCount, plural, one {Studio} other {Studios}}', viewfullcrew: 'View Full Crew', view: 'View', areyousure: 'Are you sure?', @@ -667,19 +667,24 @@ const MovieDetails: React.FC = ({ movie }) => { )} - {data.productionCompanies[0] && ( + {data.productionCompanies.length > 0 && (
- {intl.formatMessage(messages.studio)} + {intl.formatMessage(messages.studio, { + studioCount: data.productionCompanies.length, + })} - - - {data.productionCompanies[0].name} - - + {data.productionCompanies.map((s) => { + return ( + + {s.name} + + ); + })}
)} diff --git a/src/components/TvDetails/index.tsx b/src/components/TvDetails/index.tsx index e93fa94c..930f6a6a 100644 --- a/src/components/TvDetails/index.tsx +++ b/src/components/TvDetails/index.tsx @@ -62,7 +62,7 @@ const messages = defineMessages({ decline: 'Decline', showtype: 'Show Type', anime: 'Anime', - network: 'Network', + network: '{networkCount, plural, one {Network} other {Networks}}', viewfullcrew: 'View Full Crew', areyousure: 'Are you sure?', opensonarr: 'Open Series in Sonarr', @@ -694,7 +694,9 @@ const TvDetails: React.FC = ({ tv }) => { {data.networks.length > 0 && (
- {intl.formatMessage(messages.network)} + {intl.formatMessage(messages.network, { + networkCount: data.networks.length, + })} {data.networks diff --git a/src/i18n/locale/en.json b/src/i18n/locale/en.json index 87e56b6b..b31125ed 100644 --- a/src/i18n/locale/en.json +++ b/src/i18n/locale/en.json @@ -85,7 +85,7 @@ "components.MovieDetails.similar": "Similar Titles", "components.MovieDetails.similarsubtext": "Other movies similar to {title}", "components.MovieDetails.status": "Status", - "components.MovieDetails.studio": "Studio", + "components.MovieDetails.studio": "{studioCount, plural, one {Studio} other {Studios}}", "components.MovieDetails.unavailable": "Unavailable", "components.MovieDetails.userrating": "User Rating", "components.MovieDetails.view": "View", @@ -623,7 +623,7 @@ "components.TvDetails.manageModalTitle": "Manage Series", "components.TvDetails.mark4kavailable": "Mark 4K as Available", "components.TvDetails.markavailable": "Mark as Available", - "components.TvDetails.network": "Network", + "components.TvDetails.network": "{networkCount, plural, one {Network} other {Networks}}", "components.TvDetails.nextAirDate": "Next Air Date", "components.TvDetails.opensonarr": "Open Series in Sonarr", "components.TvDetails.opensonarr4k": "Open Series in 4K Sonarr",