feat: add rating and sort by rating feature to tags#7025
Open
slick-daddy wants to merge 8 commits into
Open
feat: add rating and sort by rating feature to tags#7025slick-daddy wants to merge 8 commits into
slick-daddy wants to merge 8 commits into
Conversation
slick-daddy
marked this pull request as ready for review
June 11, 2026 04:38
Collaborator
|
Needs import/export support. |
TestTagQueryRating100 iterated over query results to assert the rating filter, but createTags never set a rating, so every fixture tag had a NULL rating and the assertion loop ran zero iterations for the Equals, NotEquals, GreaterThan, and LessThan modifiers. The test passed without exercising the filter. Seed ratings the same way createPerformers and createScenes do, via getRating(index)/getIntPtr, so the existing verifyTagsRating100 checks run against real data and would catch a regression in the filter.
Remove the explicit case "rating" in getTagSort. The default branch's getSort already produces "ORDER BY tags.rating <dir>" for sort="rating", matching how studios and performers sort by rating. Add a rating case to TestTagQuerySort to guard the equivalence. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Added full rating support for tags, bringing them in line with other entities like scenes, performers, and studios.
Changes
Database
Added a
ratingcolumn (tinyint) to thetagstable via a new migration (86_tag_rating.up.sql), bumping the schema version to 86. Ratings are stored on a 0–100 scale, consistent with the rest of the application.Backend
Ratingfield to theTagandTagPartialmodel structs, storing the value on a 0–100 scalerating100on theTagtype and theTagCreateInput,TagUpdateInput, andBulkTagUpdateInputinputs, matching the naming used by scenes, performers, and studiosrating100input through theTagCreate,TagUpdate, andBulkTagUpdatemutation resolvers, and added aRating100field resolver that maps the GraphQLrating100field to the model'sRatingratingcolumn to the sqlite tag row mapping (read, write, and partial update)rating100to the GraphQLTagFilterTypeschema and wired it to thetags.ratingcolumn in the SQL filter handler intag_filter.go, enabling tags to be queried by ratingratingas a tag sort option, sorted via the shared sort handlerpkg/tag/export.go,pkg/tag/import.go)go generateFrontend
rating100to theTagData,SelectTagData, andTagListDataGraphQL fragmentsTagDetailsPanel,TagEditPanel), including the compressed detail headerTagCardand an inline click-to-rate rating column to the tag list table (TagListTable)TagList.tsx,models/list-filter/tags.ts)FindTagDocumenttotagMutationImpactedQueriesso the tag detail page refetches after a rating changegqlgenRelated Issue
Related #6564, closes the longstanding #1400
Testing
Checklist
AI Usage Disclosure
SWE 1.6 pro used for draft. Tests are written by AI. Review by me and some fixes found with Claude.
Additional Context
TagPartialStructTagPartialis used byUpdatePartialto perform partial updates — only fields explicitly set (viaOptionalInt) are written to the database.Ratingis included onTagPartial, not justTag, so that rating-only edits (e.g. clicking a star in the list view) persist without requiring the client to resend other tag fields.