mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Include gender in performer scraper results (#448)
* Fix scraper gender * Set scraped gender in the UI * Match gender on enum or case insensitive string
This commit is contained in:
@@ -717,12 +717,26 @@ export class StashService {
|
||||
}
|
||||
}
|
||||
|
||||
public static stringToGender(value?: string) {
|
||||
public static stringToGender(value?: string, caseInsensitive?: boolean) {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return StashService.stringGenderMap.get(value);
|
||||
const ret = StashService.stringGenderMap.get(value);
|
||||
if (ret || !caseInsensitive) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
const asUpper = value.toUpperCase();
|
||||
const foundEntry = Array.from(StashService.stringGenderMap.entries()).find(
|
||||
(e) => {
|
||||
return e[0].toUpperCase() === asUpper;
|
||||
}
|
||||
);
|
||||
|
||||
if (foundEntry) {
|
||||
return foundEntry[1];
|
||||
}
|
||||
}
|
||||
|
||||
public static getGenderStrings() {
|
||||
|
||||
Reference in New Issue
Block a user