Skip to content

Add gallery sorting by performer age#6879

Open
slick-daddy wants to merge 6 commits intostashapp:developfrom
slick-daddy:codex/create-new-branch-list-field
Open

Add gallery sorting by performer age#6879
slick-daddy wants to merge 6 commits intostashapp:developfrom
slick-daddy:codex/create-new-branch-list-field

Conversation

@slick-daddy
Copy link
Copy Markdown
Contributor

@slick-daddy slick-daddy commented Apr 30, 2026

Provides the ability to sort galleries by performer age so users can find galleries based on the youngest or oldest performers associated with a gallery. Related #2956 and #5788

Description

  • Add performer_age to gallerySortOptions and implement sorting logic in setGallerySort that uses a subquery to compute performer age with MIN/MAX aggregation and COALESCE fallbacks based on sort direction.
  • Add test cases for performer_age ascending and descending to TestGalleryQuerySorting in gallery_test.go.
  • Expose the sort option in the frontend by adding the performer_age entry to sortByOptions and creating PerformerAgeCriterionOption in ui/v2.5/src/models/list-filter/galleries.ts.

Testing

  • Ran the targeted backend unit test go test ./pkg/sqlite -run TestGalleryQuerySorting which includes the new performer_age cases and it passed.
  • Ran the full backend test suite go test ./... and it completed successfully.

The only problem is this PR includes one of my open PR's as well. I assumed it will be merged as well. It can be removed.
Linter may fail due to high integer in fallback part but it can changed to any high number, the result will be same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant