mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34: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:
@@ -71,6 +71,21 @@ const makePerformerGalleriesUrl = (
|
||||
return `/galleries?${filter.makeQueryParameters()}`;
|
||||
};
|
||||
|
||||
const makePerformerMoviesUrl = (
|
||||
performer: Partial<GQL.PerformerDataFragment>,
|
||||
extraCriteria?: Criterion<CriterionValue>[]
|
||||
) => {
|
||||
if (!performer.id) return "#";
|
||||
const filter = new ListFilterModel(GQL.FilterMode.Movies);
|
||||
const criterion = new PerformersCriterion();
|
||||
criterion.value = [
|
||||
{ id: performer.id, label: performer.name || `Performer ${performer.id}` },
|
||||
];
|
||||
filter.criteria.push(criterion);
|
||||
addExtraCriteria(filter.criteria, extraCriteria);
|
||||
return `/movies?${filter.makeQueryParameters()}`;
|
||||
};
|
||||
|
||||
const makePerformersCountryUrl = (
|
||||
performer: Partial<GQL.PerformerDataFragment>
|
||||
) => {
|
||||
@@ -118,6 +133,18 @@ const makeStudioGalleriesUrl = (studio: Partial<GQL.StudioDataFragment>) => {
|
||||
return `/galleries?${filter.makeQueryParameters()}`;
|
||||
};
|
||||
|
||||
const makeStudioMoviesUrl = (studio: Partial<GQL.StudioDataFragment>) => {
|
||||
if (!studio.id) return "#";
|
||||
const filter = new ListFilterModel(GQL.FilterMode.Movies);
|
||||
const criterion = new StudiosCriterion();
|
||||
criterion.value = {
|
||||
items: [{ id: studio.id, label: studio.name || `Studio ${studio.id}` }],
|
||||
depth: 0,
|
||||
};
|
||||
filter.criteria.push(criterion);
|
||||
return `/movies?${filter.makeQueryParameters()}`;
|
||||
};
|
||||
|
||||
const makeChildStudiosUrl = (studio: Partial<GQL.StudioDataFragment>) => {
|
||||
if (!studio.id) return "#";
|
||||
const filter = new ListFilterModel(GQL.FilterMode.Studios);
|
||||
@@ -226,10 +253,12 @@ export default {
|
||||
makePerformerScenesUrl,
|
||||
makePerformerImagesUrl,
|
||||
makePerformerGalleriesUrl,
|
||||
makePerformerMoviesUrl,
|
||||
makePerformersCountryUrl,
|
||||
makeStudioScenesUrl,
|
||||
makeStudioImagesUrl,
|
||||
makeStudioGalleriesUrl,
|
||||
makeStudioMoviesUrl,
|
||||
makeTagSceneMarkersUrl,
|
||||
makeTagScenesUrl,
|
||||
makeTagPerformersUrl,
|
||||
|
||||
Reference in New Issue
Block a user