diff --git a/pkg/sqlite/performer.go b/pkg/sqlite/performer.go index 4c7c4697a..0cba2dcfe 100644 --- a/pkg/sqlite/performer.go +++ b/pkg/sqlite/performer.go @@ -500,6 +500,12 @@ func (qb *performerQueryBuilder) getPerformerSort(findFilter *models.FindFilterT if sort == "scenes_count" { return getCountSort(performerTable, performersScenesTable, performerIDColumn, direction) } + if sort == "images_count" { + return getCountSort(performerTable, performersImagesTable, performerIDColumn, direction) + } + if sort == "galleries_count" { + return getCountSort(performerTable, performersGalleriesTable, performerIDColumn, direction) + } return getSort(sort, direction, "performers") } diff --git a/ui/v2.5/src/components/Changelog/versions/v090.md b/ui/v2.5/src/components/Changelog/versions/v090.md index 929556c08..b53c8a86b 100644 --- a/ui/v2.5/src/components/Changelog/versions/v090.md +++ b/ui/v2.5/src/components/Changelog/versions/v090.md @@ -1,4 +1,5 @@ ### ✨ New Features +* Added sort by options for image and gallery count for performers. ([#1671](https://github.com/stashapp/stash/pull/1671)) * Added sort by options for date, duration and rating for movies. ([#1663](https://github.com/stashapp/stash/pull/1663)) * Allow saving query page zoom level in saved and default filters. ([#1636](https://github.com/stashapp/stash/pull/1636)) * Support custom page sizes in the query page size dropdown. ([#1636](https://github.com/stashapp/stash/pull/1636)) diff --git a/ui/v2.5/src/components/Performers/PerformerListTable.tsx b/ui/v2.5/src/components/Performers/PerformerListTable.tsx index c746b1e9d..c96e4ce1b 100644 --- a/ui/v2.5/src/components/Performers/PerformerListTable.tsx +++ b/ui/v2.5/src/components/Performers/PerformerListTable.tsx @@ -1,10 +1,11 @@ /* eslint-disable jsx-a11y/control-has-associated-label */ import React from "react"; +import { useIntl } from "react-intl"; import { Button, Table } from "react-bootstrap"; import { Link } from "react-router-dom"; import * as GQL from "src/core/generated-graphql"; -import { Icon, TruncatedText } from "src/components/Shared"; +import { Icon } from "src/components/Shared"; import { NavUtils } from "src/utils"; interface IPerformerListTableProps { @@ -14,6 +15,8 @@ interface IPerformerListTableProps { export const PerformerListTable: React.FC = ( props: IPerformerListTableProps ) => { + const intl = useIntl(); + const renderPerformerRow = (performer: GQL.PerformerDataFragment) => ( @@ -27,9 +30,7 @@ export const PerformerListTable: React.FC = ( -
- -
+
{performer.name}
{performer.aliases ? performer.aliases : ""} @@ -45,6 +46,16 @@ export const PerformerListTable: React.FC = (
{performer.scene_count}
+ + +
{performer.image_count}
+ + + + +
{performer.gallery_count}
+ + {performer.birthdate} {performer.height} @@ -56,12 +67,14 @@ export const PerformerListTable: React.FC = ( - Name - Aliases - Favourite - Scene Count - Birthdate - Height + {intl.formatMessage({ id: "name" })} + {intl.formatMessage({ id: "aliases" })} + {intl.formatMessage({ id: "favourite" })} + {intl.formatMessage({ id: "scene_count" })} + {intl.formatMessage({ id: "image_count" })} + {intl.formatMessage({ id: "gallery_count" })} + {intl.formatMessage({ id: "birthdate" })} + {intl.formatMessage({ id: "height" })} {props.performers.map(renderPerformerRow)} diff --git a/ui/v2.5/src/components/Scenes/SceneListTable.tsx b/ui/v2.5/src/components/Scenes/SceneListTable.tsx index c6b20c382..d5b8f8f02 100644 --- a/ui/v2.5/src/components/Scenes/SceneListTable.tsx +++ b/ui/v2.5/src/components/Scenes/SceneListTable.tsx @@ -5,7 +5,7 @@ import { Table, Button, Form } from "react-bootstrap"; import { Link } from "react-router-dom"; import * as GQL from "src/core/generated-graphql"; import { NavUtils, TextUtils } from "src/utils"; -import { Icon, TruncatedText } from "src/components/Shared"; +import { Icon } from "src/components/Shared"; import { FormattedMessage } from "react-intl"; interface ISceneListTableProps { @@ -80,11 +80,7 @@ export const SceneListTable: React.FC = ( -
- -
+
{scene.title ?? TextUtils.fileNameFromPath(scene.path)}
{scene.rating ? scene.rating : ""} diff --git a/ui/v2.5/src/index.scss b/ui/v2.5/src/index.scss index 06b563582..c290aaeeb 100755 --- a/ui/v2.5/src/index.scss +++ b/ui/v2.5/src/index.scss @@ -89,6 +89,10 @@ textarea.text-input { overflow-y: scroll; } +.table-list { + min-width: min-content; +} + .table-list a { color: $text-color; } diff --git a/ui/v2.5/src/models/list-filter/performers.ts b/ui/v2.5/src/models/list-filter/performers.ts index 6fc10e5bf..4cc5eb045 100644 --- a/ui/v2.5/src/models/list-filter/performers.ts +++ b/ui/v2.5/src/models/list-filter/performers.ts @@ -27,6 +27,14 @@ const sortByOptions = [ messageID: "scene_count", value: "scenes_count", }, + { + messageID: "image_count", + value: "images_count", + }, + { + messageID: "gallery_count", + value: "galleries_count", + }, ]); const displayModeOptions = [