Skip to content

Commit

Permalink
filter galleries for photographer
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAxolotl committed Nov 2, 2022
1 parent a9d0fc6 commit 8e93591
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions graphql/schema/types/filters.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ input GalleryFilterType {

title: StringCriterionInput
details: StringCriterionInput
photographer: StringCriterionInput

"""Filter by file checksum"""
checksum: StringCriterionInput
Expand Down
1 change: 1 addition & 0 deletions pkg/sqlite/gallery.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ func (qb *GalleryStore) makeFilter(ctx context.Context, galleryFilter *models.Ga

query.handleCriterion(ctx, stringCriterionHandler(galleryFilter.Title, "galleries.title"))
query.handleCriterion(ctx, stringCriterionHandler(galleryFilter.Details, "galleries.details"))
query.handleCriterion(ctx, stringCriterionHandler(galleryFilter.Photographer, "galleries.photographer"))

query.handleCriterion(ctx, criterionHandlerFunc(func(ctx context.Context, f *filterBuilder) {
if galleryFilter.Checksum != nil {
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/models/list-filter/criteria/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export function makeCriteria(type: CriterionType = "none") {
case "director":
case "synopsis":
case "description":
case "photographer":
return new StringCriterion(new StringCriterionOption(type, type));
case "code":
return new StringCriterion(new StringCriterionOption("scene_code", type));
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/models/list-filter/galleries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const displayModeOptions = [
const criterionOptions = [
createStringCriterionOption("title"),
createStringCriterionOption("details"),
createStringCriterionOption("photographer"),
createStringCriterionOption("path"),
createStringCriterionOption(
"galleryChecksum",
Expand Down
3 changes: 2 additions & 1 deletion ui/v2.5/src/models/list-filter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,5 @@ export type CriterionType =
| "ignore_auto_tag"
| "file_count"
| "description"
| "code";
| "code"
| "photographer";

0 comments on commit 8e93591

Please sign in to comment.