Skip to content

Commit

Permalink
Make ethnicity freetext and fix freeones ethnicity panic (stashapp#431)
Browse files Browse the repository at this point in the history
* Make ethnicity free text

* Fix panic in freeones scraper for other ethnicity
  • Loading branch information
WithoutPants authored Apr 1, 2020
1 parent 8ac369d commit 9b03995
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pkg/scraper/freeones.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}

Expand Down

0 comments on commit 9b03995

Please sign in to comment.