Fix performers/studio/tags updating after parse (#229)

This commit is contained in:
WithoutPants 2019-12-02 03:19:44 +11:00 committed by Leopere
parent 1704d3771f
commit 1760f4fdcf
1 changed files with 4 additions and 5 deletions

View File

@ -186,7 +186,7 @@ class SceneParserResult {
// returns true if any of its fields have set == true
public isChanged() {
return this.title.set || this.date.set;
return this.title.set || this.date.set || this.performerIds.set || this.studioId.set || this.tagIds.set;
}
public toSceneUpdateInput() {
@ -205,7 +205,9 @@ class SceneParserResult {
SceneParserResult.setInput(ret, "title", this.title);
SceneParserResult.setInput(ret, "date", this.date);
// TODO - other fields as added
SceneParserResult.setInput(ret, "performer_ids", this.performerIds);
SceneParserResult.setInput(ret, "studio_id", this.studioId);
SceneParserResult.setInput(ret, "tag_ids", this.tagIds);
return ret;
}
@ -274,9 +276,6 @@ const builtInRecipes = [
}
];
// TODO:
// Add mappings for tags, performers, studio
export const SceneFilenameParser: FunctionComponent<IProps> = (props: IProps) => {
const [parserResult, setParserResult] = useState<SceneParserResult[]>([]);
const [parserInput, setParserInput] = useState<IParserInput>(initialParserInput());