From 3683d892979971bd28a0f17457eadd9f25f3f538 Mon Sep 17 00:00:00 2001 From: Kermie Date: Mon, 27 Dec 2021 06:14:47 -0800 Subject: [PATCH 1/7] Show stats on entity list tabs --- .../Performers/PerformerDetails/Performer.tsx | 50 +++++++++++++++-- .../Studios/StudioDetails/Studio.tsx | 56 +++++++++++++++++-- .../src/components/Tags/TagDetails/Tag.tsx | 53 ++++++++++++++++-- ui/v2.5/src/index.scss | 4 ++ 4 files changed, 146 insertions(+), 17 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index c31f7ef0a9e..42cde433073 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useMemo, useState } from "react"; -import { Button, Tabs, Tab } from "react-bootstrap"; +import { Button, Tabs, Tab, Badge } from "react-bootstrap"; import { FormattedMessage, useIntl } from "react-intl"; import { useParams, useHistory } from "react-router-dom"; import { Helmet } from "react-helmet"; @@ -147,16 +147,56 @@ const PerformerPage: React.FC = ({ performer }) => { - + + {intl.formatMessage({ id: "scenes" })} + + {performer.scene_count} + + + } + > - + + {intl.formatMessage({ id: "galleries" })} + + {performer.gallery_count} + + + } + > - + + {intl.formatMessage({ id: "images" })} + + {performer.image_count} + + + } + > - + + {intl.formatMessage({ id: "movies" })} + + {performer.movie_count} + + + } + > diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index 9d95ecea774..b82b2e2edd6 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -1,4 +1,4 @@ -import { Tabs, Tab } from "react-bootstrap"; +import { Tabs, Tab, Badge } from "react-bootstrap"; import React, { useEffect, useState } from "react"; import { useParams, useHistory } from "react-router-dom"; import { FormattedMessage, useIntl } from "react-intl"; @@ -216,16 +216,43 @@ const StudioPage: React.FC = ({ studio }) => { activeKey={activeTabKey} onSelect={setActiveTabKey} > - + + {intl.formatMessage({ id: "scenes" })} + + {studio.scene_count} + + + } + > + {intl.formatMessage({ id: "galleries" })} + + {studio.gallery_count} + + + } > - + + {intl.formatMessage({ id: "images" })} + + {studio.image_count} + + + } + > = ({ studio }) => { > - + + {intl.formatMessage({ id: "movies" })} + + {studio.movie_count} + + + } + > + {intl.formatMessage({ id: "subsidiary_studios" })} + + {studio.child_studios.length} + + + } > diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index 99259be34b2..eefcc92d2f2 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -1,4 +1,4 @@ -import { Tabs, Tab, Dropdown } from "react-bootstrap"; +import { Tabs, Tab, Dropdown, Badge } from "react-bootstrap"; import React, { useEffect, useState } from "react"; import { useParams, useHistory } from "react-router-dom"; import { FormattedMessage, useIntl } from "react-intl"; @@ -297,27 +297,68 @@ const TagPage: React.FC = ({ tag }) => { activeKey={activeTabKey} onSelect={setActiveTabKey} > - + + {intl.formatMessage({ id: "scenes" })} + + {tag.scene_count} + + + } + > - + + {intl.formatMessage({ id: "images" })} + + {tag.image_count} + + + } + > + {intl.formatMessage({ id: "galleries" })} + + {tag.gallery_count} + + + } > + {intl.formatMessage({ id: "markers" })} + + {tag.scene_marker_count} + + + } > + {intl.formatMessage({ id: "performers" })} + + {tag.performer_count} + + + } > diff --git a/ui/v2.5/src/index.scss b/ui/v2.5/src/index.scss index 2ac93c8d35a..a67e1e504ac 100755 --- a/ui/v2.5/src/index.scss +++ b/ui/v2.5/src/index.scss @@ -752,3 +752,7 @@ select { background: url("data:image/svg+xml;utf8,") no-repeat right 2px center; } + +.left-spacing { + margin-left: 0.5em; +} From 84032aabaede10bdd98090c7c3100e2dd306ddce Mon Sep 17 00:00:00 2001 From: Kermie Date: Mon, 27 Dec 2021 15:50:20 -0800 Subject: [PATCH 2/7] Add number formatting --- .../Performers/PerformerDetails/Performer.tsx | 8 ++++---- .../src/components/Studios/StudioDetails/Studio.tsx | 10 +++++----- ui/v2.5/src/components/Tags/TagDetails/Tag.tsx | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index 42cde433073..99de2bcda59 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -153,7 +153,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "scenes" })} - {performer.scene_count} + {(performer.scene_count)?.toLocaleString()} } @@ -166,7 +166,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "galleries" })} - {performer.gallery_count} + {(performer.gallery_count)?.toLocaleString()} } @@ -179,7 +179,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "images" })} - {performer.image_count} + {(performer.image_count)?.toLocaleString()} } @@ -192,7 +192,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "movies" })} - {performer.movie_count} + {(performer.movie_count)?.toLocaleString()} } diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index b82b2e2edd6..f89d7ecfca9 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -222,7 +222,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "scenes" })} - {studio.scene_count} + {(studio.scene_count)?.toLocaleString()} } @@ -235,7 +235,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "galleries" })} - {studio.gallery_count} + {(studio.gallery_count)?.toLocaleString()} } @@ -248,7 +248,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "images" })} - {studio.image_count} + {(studio.image_count)?.toLocaleString()} } @@ -267,7 +267,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "movies" })} - {studio.movie_count} + {(studio.movie_count)?.toLocaleString()} } @@ -280,7 +280,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "subsidiary_studios" })} - {studio.child_studios.length} + {(studio.child_studios.length)?.toLocaleString()} } diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index eefcc92d2f2..d1a2d96e56f 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -303,7 +303,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "scenes" })} - {tag.scene_count} + {(tag.scene_count)?.toLocaleString()} } @@ -316,7 +316,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "images" })} - {tag.image_count} + {(tag.image_count)?.toLocaleString()} } @@ -329,7 +329,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "galleries" })} - {tag.gallery_count} + {(tag.gallery_count)?.toLocaleString()} } @@ -342,7 +342,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "markers" })} - {tag.scene_marker_count} + {(tag.scene_marker_count)?.toLocaleString()} } @@ -355,7 +355,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "performers" })} - {tag.performer_count} + {(tag.performer_count)?.toLocaleString()} } From 80444db943b3c3e6f05ee1bbf33195fada106050 Mon Sep 17 00:00:00 2001 From: Kermie Date: Mon, 27 Dec 2021 15:51:02 -0800 Subject: [PATCH 3/7] Run prettier --- .../Performers/PerformerDetails/Performer.tsx | 8 ++++---- .../src/components/Studios/StudioDetails/Studio.tsx | 10 +++++----- ui/v2.5/src/components/Tags/TagDetails/Tag.tsx | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index 99de2bcda59..9d2b9115a0f 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -153,7 +153,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "scenes" })} - {(performer.scene_count)?.toLocaleString()} + {performer.scene_count?.toLocaleString()} } @@ -166,7 +166,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "galleries" })} - {(performer.gallery_count)?.toLocaleString()} + {performer.gallery_count?.toLocaleString()} } @@ -179,7 +179,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "images" })} - {(performer.image_count)?.toLocaleString()} + {performer.image_count?.toLocaleString()} } @@ -192,7 +192,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "movies" })} - {(performer.movie_count)?.toLocaleString()} + {performer.movie_count?.toLocaleString()} } diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index f89d7ecfca9..5c6dc424553 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -222,7 +222,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "scenes" })} - {(studio.scene_count)?.toLocaleString()} + {studio.scene_count?.toLocaleString()} } @@ -235,7 +235,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "galleries" })} - {(studio.gallery_count)?.toLocaleString()} + {studio.gallery_count?.toLocaleString()} } @@ -248,7 +248,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "images" })} - {(studio.image_count)?.toLocaleString()} + {studio.image_count?.toLocaleString()} } @@ -267,7 +267,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "movies" })} - {(studio.movie_count)?.toLocaleString()} + {studio.movie_count?.toLocaleString()} } @@ -280,7 +280,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "subsidiary_studios" })} - {(studio.child_studios.length)?.toLocaleString()} + {studio.child_studios.length?.toLocaleString()} } diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index d1a2d96e56f..faa0c5a9df7 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -303,7 +303,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "scenes" })} - {(tag.scene_count)?.toLocaleString()} + {tag.scene_count?.toLocaleString()} } @@ -316,7 +316,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "images" })} - {(tag.image_count)?.toLocaleString()} + {tag.image_count?.toLocaleString()} } @@ -329,7 +329,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "galleries" })} - {(tag.gallery_count)?.toLocaleString()} + {tag.gallery_count?.toLocaleString()} } @@ -342,7 +342,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "markers" })} - {(tag.scene_marker_count)?.toLocaleString()} + {tag.scene_marker_count?.toLocaleString()} } @@ -355,7 +355,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "performers" })} - {(tag.performer_count)?.toLocaleString()} + {tag.performer_count?.toLocaleString()} } From d2d220abfaa22836686208f9927fbfb61f5f7fe4 Mon Sep 17 00:00:00 2001 From: Kermie Date: Fri, 31 Dec 2021 01:01:55 -0800 Subject: [PATCH 4/7] Use intl for number formatting --- .../Performers/PerformerDetails/Performer.tsx | 8 ++++---- .../src/components/Settings/SettingsServicesPanel.tsx | 2 +- .../src/components/Studios/StudioDetails/Studio.tsx | 10 +++++----- ui/v2.5/src/components/Tags/TagDetails/Tag.tsx | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index 9d2b9115a0f..7601511e868 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -153,7 +153,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "scenes" })} - {performer.scene_count?.toLocaleString()} + {performer.scene_count ? intl.formatNumber(performer.scene_count): 0} } @@ -166,7 +166,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "galleries" })} - {performer.gallery_count?.toLocaleString()} + {performer.gallery_count ? intl.formatNumber(performer.gallery_count): 0} } @@ -179,7 +179,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "images" })} - {performer.image_count?.toLocaleString()} + {performer.image_count ? intl.formatNumber(performer.image_count): 0} } @@ -192,7 +192,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "movies" })} - {performer.movie_count?.toLocaleString()} + {performer.movie_count ? intl.formatNumber(performer.movie_count): 0} } diff --git a/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx b/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx index 2bc7c97612b..e15c29ead70 100644 --- a/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx +++ b/ui/v2.5/src/components/Settings/SettingsServicesPanel.tsx @@ -117,7 +117,7 @@ export const SettingsServicesPanel: React.FC = () => { function renderDeadline(until?: string) { if (until) { const deadline = new Date(until); - return `until ${deadline.toLocaleString()}`; + return `until ${intl.formatDate(deadline)}`; } return ""; diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index 5c6dc424553..6a8b6f5543e 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -222,7 +222,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "scenes" })} - {studio.scene_count?.toLocaleString()} + {studio.scene_count ? intl.formatNumber(studio.scene_count): 0} } @@ -235,7 +235,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "galleries" })} - {studio.gallery_count?.toLocaleString()} + {studio.gallery_count ? intl.formatNumber(studio.gallery_count): 0} } @@ -248,7 +248,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "images" })} - {studio.image_count?.toLocaleString()} + {studio.image_count ? intl.formatNumber(studio.image_count): 0} } @@ -267,7 +267,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "movies" })} - {studio.movie_count?.toLocaleString()} + {studio.movie_count ? intl.formatNumber(studio.movie_count): 0} } @@ -280,7 +280,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "subsidiary_studios" })} - {studio.child_studios.length?.toLocaleString()} + {intl.formatNumber(studio.child_studios?.length)} } diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index faa0c5a9df7..4712526cc4c 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -303,7 +303,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "scenes" })} - {tag.scene_count?.toLocaleString()} + {tag.scene_count ? intl.formatNumber(tag.scene_count): 0} } @@ -316,7 +316,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "images" })} - {tag.image_count?.toLocaleString()} + {tag.image_count ? intl.formatNumber(tag.image_count): 0} } @@ -329,7 +329,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "galleries" })} - {tag.gallery_count?.toLocaleString()} + {tag.gallery_count ? intl.formatNumber(tag.gallery_count): 0} } @@ -342,7 +342,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "markers" })} - {tag.scene_marker_count?.toLocaleString()} + {tag.scene_marker_count ? intl.formatNumber(tag.scene_marker_count): 0} } @@ -355,7 +355,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "performers" })} - {tag.performer_count?.toLocaleString()} + {tag.performer_count ? intl.formatNumber(tag.performer_count): 0} } From 134f8e654aeb606801a46d1ee5437f30fb3a72d3 Mon Sep 17 00:00:00 2001 From: Kermie Date: Fri, 31 Dec 2021 01:02:34 -0800 Subject: [PATCH 5/7] make fmt-ui --- .../Performers/PerformerDetails/Performer.tsx | 16 ++++++++++++---- .../components/Studios/StudioDetails/Studio.tsx | 16 ++++++++++++---- ui/v2.5/src/components/Tags/TagDetails/Tag.tsx | 16 +++++++++++----- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index 7601511e868..70adccc0bed 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -153,7 +153,9 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "scenes" })} - {performer.scene_count ? intl.formatNumber(performer.scene_count): 0} + {performer.scene_count + ? intl.formatNumber(performer.scene_count) + : 0} } @@ -166,7 +168,9 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "galleries" })} - {performer.gallery_count ? intl.formatNumber(performer.gallery_count): 0} + {performer.gallery_count + ? intl.formatNumber(performer.gallery_count) + : 0} } @@ -179,7 +183,9 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "images" })} - {performer.image_count ? intl.formatNumber(performer.image_count): 0} + {performer.image_count + ? intl.formatNumber(performer.image_count) + : 0} } @@ -192,7 +198,9 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "movies" })} - {performer.movie_count ? intl.formatNumber(performer.movie_count): 0} + {performer.movie_count + ? intl.formatNumber(performer.movie_count) + : 0} } diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index 6a8b6f5543e..e48f7541265 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -222,7 +222,9 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "scenes" })} - {studio.scene_count ? intl.formatNumber(studio.scene_count): 0} + {studio.scene_count + ? intl.formatNumber(studio.scene_count) + : 0} } @@ -235,7 +237,9 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "galleries" })} - {studio.gallery_count ? intl.formatNumber(studio.gallery_count): 0} + {studio.gallery_count + ? intl.formatNumber(studio.gallery_count) + : 0} } @@ -248,7 +252,9 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "images" })} - {studio.image_count ? intl.formatNumber(studio.image_count): 0} + {studio.image_count + ? intl.formatNumber(studio.image_count) + : 0} } @@ -267,7 +273,9 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "movies" })} - {studio.movie_count ? intl.formatNumber(studio.movie_count): 0} + {studio.movie_count + ? intl.formatNumber(studio.movie_count) + : 0} } diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index 4712526cc4c..9b5bd2180b9 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -303,7 +303,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "scenes" })} - {tag.scene_count ? intl.formatNumber(tag.scene_count): 0} + {tag.scene_count ? intl.formatNumber(tag.scene_count) : 0} } @@ -316,7 +316,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "images" })} - {tag.image_count ? intl.formatNumber(tag.image_count): 0} + {tag.image_count ? intl.formatNumber(tag.image_count) : 0} } @@ -329,7 +329,9 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "galleries" })} - {tag.gallery_count ? intl.formatNumber(tag.gallery_count): 0} + {tag.gallery_count + ? intl.formatNumber(tag.gallery_count) + : 0} } @@ -342,7 +344,9 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "markers" })} - {tag.scene_marker_count ? intl.formatNumber(tag.scene_marker_count): 0} + {tag.scene_marker_count + ? intl.formatNumber(tag.scene_marker_count) + : 0} } @@ -355,7 +359,9 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "performers" })} - {tag.performer_count ? intl.formatNumber(tag.performer_count): 0} + {tag.performer_count + ? intl.formatNumber(tag.performer_count) + : 0} } From 5960404d9aa0552d44f1c36db047370691150d18 Mon Sep 17 00:00:00 2001 From: Kermie Date: Fri, 31 Dec 2021 01:24:20 -0800 Subject: [PATCH 6/7] Internationalize the 0 too --- .../Performers/PerformerDetails/Performer.tsx | 16 ++++------------ .../components/Studios/StudioDetails/Studio.tsx | 16 ++++------------ ui/v2.5/src/components/Tags/TagDetails/Tag.tsx | 16 +++++----------- 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx index 70adccc0bed..94f69a1cdec 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/Performer.tsx @@ -153,9 +153,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "scenes" })} - {performer.scene_count - ? intl.formatNumber(performer.scene_count) - : 0} + {intl.formatNumber(performer.scene_count ?? 0)} } @@ -168,9 +166,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "galleries" })} - {performer.gallery_count - ? intl.formatNumber(performer.gallery_count) - : 0} + {intl.formatNumber(performer.gallery_count ?? 0)} } @@ -183,9 +179,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "images" })} - {performer.image_count - ? intl.formatNumber(performer.image_count) - : 0} + {intl.formatNumber(performer.image_count ?? 0)} } @@ -198,9 +192,7 @@ const PerformerPage: React.FC = ({ performer }) => { {intl.formatMessage({ id: "movies" })} - {performer.movie_count - ? intl.formatNumber(performer.movie_count) - : 0} + {intl.formatNumber(performer.movie_count ?? 0)} } diff --git a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx index e48f7541265..56875b40c13 100644 --- a/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx +++ b/ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx @@ -222,9 +222,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "scenes" })} - {studio.scene_count - ? intl.formatNumber(studio.scene_count) - : 0} + {intl.formatNumber(studio.scene_count ?? 0)} } @@ -237,9 +235,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "galleries" })} - {studio.gallery_count - ? intl.formatNumber(studio.gallery_count) - : 0} + {intl.formatNumber(studio.gallery_count ?? 0)} } @@ -252,9 +248,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "images" })} - {studio.image_count - ? intl.formatNumber(studio.image_count) - : 0} + {intl.formatNumber(studio.image_count ?? 0)} } @@ -273,9 +267,7 @@ const StudioPage: React.FC = ({ studio }) => { {intl.formatMessage({ id: "movies" })} - {studio.movie_count - ? intl.formatNumber(studio.movie_count) - : 0} + {intl.formatNumber(studio.movie_count ?? 0)} } diff --git a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx index 9b5bd2180b9..4b75d927fa3 100644 --- a/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx +++ b/ui/v2.5/src/components/Tags/TagDetails/Tag.tsx @@ -303,7 +303,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "scenes" })} - {tag.scene_count ? intl.formatNumber(tag.scene_count) : 0} + {intl.formatNumber(tag.scene_count ?? 0)} } @@ -316,7 +316,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "images" })} - {tag.image_count ? intl.formatNumber(tag.image_count) : 0} + {intl.formatNumber(tag.image_count ?? 0)} } @@ -329,9 +329,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "galleries" })} - {tag.gallery_count - ? intl.formatNumber(tag.gallery_count) - : 0} + {intl.formatNumber(tag.gallery_count ?? 0)} } @@ -344,9 +342,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "markers" })} - {tag.scene_marker_count - ? intl.formatNumber(tag.scene_marker_count) - : 0} + {intl.formatNumber(tag.scene_marker_count ?? 0)} } @@ -359,9 +355,7 @@ const TagPage: React.FC = ({ tag }) => { {intl.formatMessage({ id: "performers" })} - {tag.performer_count - ? intl.formatNumber(tag.performer_count) - : 0} + {intl.formatNumber(tag.performer_count ?? 0)} } From c4ee9f77913a8f9370069e9b04ebb69002fd4da0 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 4 Jan 2022 13:48:09 +1100 Subject: [PATCH 7/7] Add changelog entry --- ui/v2.5/src/components/Changelog/versions/v0130.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/v2.5/src/components/Changelog/versions/v0130.md b/ui/v2.5/src/components/Changelog/versions/v0130.md index 87c95d5f776..90bb459b404 100644 --- a/ui/v2.5/src/components/Changelog/versions/v0130.md +++ b/ui/v2.5/src/components/Changelog/versions/v0130.md @@ -1,3 +1,6 @@ +### 🎨 Improvements +Show counts on list tabs in Performer, Studio and Tag pages. ([#2169](https://github.com/stashapp/stash/pull/2169)) + ### 🐛 Bug fixes * Generate sprites for short video files. ([#2167](https://github.com/stashapp/stash/pull/2167)) * Fix stash-box scraping including underscores in ethnicity. ([#2191](https://github.com/stashapp/stash/pull/2191))