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:
WithoutPants
2020-04-11 13:26:53 +10:00
committed by GitHub
parent 6764c1f545
commit 849a5261a3
6 changed files with 57 additions and 13 deletions

View File

@@ -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() {