Skip to content

[Feature] Add configurable default performer gender #6867

Open
Stash-KennyG wants to merge 11 commits intostashapp:developfrom
Stash-KennyG:feature-3751-default-performer-gender
Open

[Feature] Add configurable default performer gender #6867
Stash-KennyG wants to merge 11 commits intostashapp:developfrom
Stash-KennyG:feature-3751-default-performer-gender

Conversation

@Stash-KennyG
Copy link
Copy Markdown
Contributor

Fixes #3751

Summary

  • add a new interface setting defaultPerformerGender (None + all gender enum values)
  • apply the setting as a fallback when creating performers without explicit gender
  • preselect default gender in new performer form, and apply it to non-stash scraper results when scraper gender is missing
  • keep explicit user/scraper gender precedence and avoid mutating existing performers

Backend

  • extend config GraphQL schema for interface input/result
  • add config key/getter and wire configure/query plumbing
  • apply fallback in performer create path
  • add tests for explicit-vs-default precedence helper behavior

UI

  • add setting in Interface > Performer List
  • reuse shared gender list source
  • fix locale key usage so dropdown shows localized labels (not raw keys)
  • add English locale strings and changelog entry
image

KennyG added 4 commits April 26, 2026 14:52
- Introduced `defaultPerformerGender` input and output fields in GraphQL schema.
- Updated configuration resolver to handle default performer gender.
- Implemented logic to use default performer gender when creating new performers or scraping data.
- Added UI component for setting default performer gender in settings panel.
- Updated localization for the new default performer gender option.
Wrap the config import in SettingsInterfacePanel to satisfy format-check in CI.

Made-with: Cursor
Update SettingsInterfacePanel formatting to satisfy UI format-check in CI.

Made-with: Cursor
Copy link
Copy Markdown
Collaborator

@Gykes Gykes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick overview. DogmaDragon will more than likely request that you update the manual to reflect this new setting so you may want to get ahead of it and add that too.

Comment thread internal/api/resolver_mutation_configure.go Outdated
Comment thread internal/manager/config/config.go
Comment thread ui/v2.5/src/components/Performers/PerformerDetails/PerformerEditPanel.tsx Outdated
KennyG added 7 commits April 30, 2026 19:47
`setConfigStrong` is a no op when the input pointer is nul. When the UI sends`null`, for when the user sets the setting back to no default, the old setting is saved.

Was able to confirm this was testing. Selecting "none" in the dropdown keeps the previous setting saved and I think this is the issue.

Built a helper or having the UI send "" instead of null could be possible solutions.

- Updated GraphQL schema to clarify the behavior of `defaultPerformerGender`, allowing an empty string to clear the setting.
- Implemented `applyDefaultPerformerGenderInput` function in the resolver to handle updates and clearing of the default performer gender.
- Adjusted the settings panel to directly pass the value for `defaultPerformerGender`, simplifying the change handling.

Made-with: Cursor
- Added a check for empty string input in `GetDefaultPerformerGender` to return nil if no gender is specified.
- Implemented logging for invalid default performer gender values to improve debugging.

This change ensures that the configuration correctly handles cases where the default performer gender is not set, enhancing the robustness of the application.
- Introduced a new utility function `withScrapedPerformerDefaultGender` to streamline the assignment of default gender when scraping performer data.
- Replaced inline gender handling logic with the new utility function in both scraping results for new and existing performers, improving code readability and maintainability.

This change enhances the clarity of gender assignment logic during performer data scraping.
- Added a section in the Configuration.md to explain the new default performer gender setting and its impact on performer data scraping.
- Updated ScraperDevelopment.md to clarify how the default performer gender is applied when gender is not specified in scraped results.
- Enhanced Scraping.md with details on how the default performer gender setting influences performer scraping.

These changes improve the clarity and usability of the documentation regarding gender handling in the application.
- Updated GraphQL schema to change `defaultPerformerGender` type to `GenderEnum` and added a new field `clearDefaultPerformerGender` for clearing the setting.
- Modified `applyDefaultPerformerGenderInput` function to accept the new input structure, allowing for clearer handling of gender updates and clearing.
- Enhanced the `SettingsInterfacePanel` to implement the new logic for saving default performer gender, improving user experience when setting or clearing the default gender.

These changes streamline the configuration process and improve the clarity of gender handling in the application.
- Updated the type definition in the `withScrapedPerformerDefaultGender` utility function to improve clarity and maintainability.
- Ensured consistency in handling optional gender values for scraped performers.

This change enhances the readability of the code related to default gender assignment during performer data processing.
Resolve the golangci-lint builtin name conflict and relax scraped performer helper typing so UI type-check passes when scraper gender is string-valued.
@Stash-KennyG Stash-KennyG requested a review from Gykes May 1, 2026 15:15
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.

[Feature] Default gender of performer

2 participants