Fix creating performer from gallery scrape dialog (#1320)

This commit is contained in:
peolic
2021-04-18 14:22:02 +03:00
committed by GitHub
parent cd0a9a1d62
commit 1759a99f65
3 changed files with 41 additions and 32 deletions

View File

@@ -16,10 +16,10 @@ import {
usePerformerCreate,
useMovieCreate,
useTagCreate,
stringToGender,
makePerformerCreateInput,
} from "src/core/StashService";
import { useToast } from "src/hooks";
import { DurationUtils, filterData } from "src/utils";
import { DurationUtils } from "src/utils";
function renderScrapedStudio(
result: ScrapeResult<string>,
@@ -361,33 +361,7 @@ export const SceneScrapeDialog: React.FC<ISceneScrapeDialogProps> = (
}
async function createNewPerformer(toCreate: GQL.ScrapedScenePerformer) {
const input: GQL.PerformerCreateInput = {
name: toCreate.name,
url: toCreate.url,
gender: stringToGender(toCreate.gender),
birthdate: toCreate.birthdate,
ethnicity: toCreate.ethnicity,
country: toCreate.country,
eye_color: toCreate.eye_color,
height: toCreate.height,
measurements: toCreate.measurements,
fake_tits: toCreate.fake_tits,
career_length: toCreate.career_length,
tattoos: toCreate.tattoos,
piercings: toCreate.piercings,
aliases: toCreate.aliases,
twitter: toCreate.twitter,
instagram: toCreate.instagram,
tag_ids: filterData((toCreate.tags ?? []).map((t) => t.stored_id)),
image:
(toCreate.images ?? []).length > 0
? (toCreate.images ?? [])[0]
: undefined,
details: toCreate.details,
death_date: toCreate.death_date,
hair_color: toCreate.hair_color,
weight: toCreate.weight ? Number(toCreate.weight) : undefined,
};
const input = makePerformerCreateInput(toCreate);
try {
const result = await createPerformer({