mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
Enhance default performer gender handling in configuration.
- 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.
This commit is contained in:
parent
b23d83f990
commit
18eedfc724
1 changed files with 7 additions and 1 deletions
|
|
@ -1313,8 +1313,14 @@ func (i *Config) GetShowStudioAsText() bool {
|
|||
}
|
||||
|
||||
func (i *Config) GetDefaultPerformerGender() *models.GenderEnum {
|
||||
g := models.GenderEnum(i.getString(DefaultPerformerGender))
|
||||
s := i.getString(DefaultPerformerGender)
|
||||
if s == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
g := models.GenderEnum(s)
|
||||
if !g.IsValid() {
|
||||
logger.Warnf("invalid default performer gender: %q", s)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue