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:
gitgiggety
2021-09-27 03:31:49 +02:00
committed by GitHub
parent 62af723017
commit be94e52f21
15 changed files with 257 additions and 3 deletions

View File

@@ -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()}