Make ethnicity freetext and fix freeones ethnicity panic (#431)

* Make ethnicity free text

* Fix panic in freeones scraper for other ethnicity
This commit is contained in:
WithoutPants 2020-04-02 08:25:39 +11:00 committed by GitHub
parent 0bbb2bd1d0
commit 82201e23e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View file

@ -278,7 +278,9 @@ func getEthnicity(ethnicity string) string {
case "Asian":
return "asian"
default:
panic("unknown ethnicity")
// #367 - unknown ethnicity shouldn't cause the entire operation to
// fail. Just return the original string instead
return ethnicity
}
}

View file

@ -221,12 +221,12 @@ export const PerformerDetailsPanel: React.FC<IPerformerDetails> = ({
}
function renderEthnicity() {
return TableUtils.renderHtmlSelect({
return TableUtils.renderInputGroup({
title: "Ethnicity",
value: ethnicity,
isEditing: !!isEditing,
onChange: (value: string) => setEthnicity(value),
selectOptions: ["white", "black", "asian", "hispanic"]
placeholder: "Ethnicity",
onChange: setEthnicity
});
}

View file

@ -228,12 +228,12 @@ export const PerformerDetailsPanel: FunctionComponent<IPerformerDetailsProps> =
}
function renderEthnicity() {
return TableUtils.renderHtmlSelect({
return TableUtils.renderInputGroup({
title: "Ethnicity",
value: ethnicity,
isEditing: !!props.isEditing,
onChange: (value: string) => setEthnicity(value),
selectOptions: ["white", "black", "asian", "hispanic"],
placeholder: "Ethnicity",
onChange: setEthnicity
});
}