mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add movie count to performer and studio card (#1760)
* Add movies and movie_count properties to Performer type Extend the GraphQL API to allow getting the movies and movie count by performer. * Add movies count to performer card * Add movies and movie_count properties to Studio type Extend the GraphQL API to allow getting the movies and movie count by studio. * Add movies count to studio card
This commit is contained in:
@@ -21,6 +21,7 @@ export interface IPerformerCardExtraCriteria {
|
||||
scenes: Criterion<CriterionValue>[];
|
||||
images: Criterion<CriterionValue>[];
|
||||
galleries: Criterion<CriterionValue>[];
|
||||
movies: Criterion<CriterionValue>[];
|
||||
}
|
||||
|
||||
interface IPerformerCardProps {
|
||||
@@ -124,18 +125,32 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
||||
);
|
||||
}
|
||||
|
||||
function maybeRenderMoviesPopoverButton() {
|
||||
if (!performer.movie_count) return;
|
||||
|
||||
return (
|
||||
<PopoverCountButton
|
||||
type="movie"
|
||||
count={performer.movie_count}
|
||||
url={NavUtils.makePerformerMoviesUrl(performer, extraCriteria?.movies)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function maybeRenderPopoverButtonGroup() {
|
||||
if (
|
||||
performer.scene_count ||
|
||||
performer.image_count ||
|
||||
performer.gallery_count ||
|
||||
performer.tags.length > 0
|
||||
performer.tags.length > 0 ||
|
||||
performer.movie_count
|
||||
) {
|
||||
return (
|
||||
<>
|
||||
<hr />
|
||||
<ButtonGroup className="card-popovers">
|
||||
{maybeRenderScenesPopoverButton()}
|
||||
{maybeRenderMoviesPopoverButton()}
|
||||
{maybeRenderImagesPopoverButton()}
|
||||
{maybeRenderGalleriesPopoverButton()}
|
||||
{maybeRenderTagPopoverButton()}
|
||||
|
||||
Reference in New Issue
Block a user