mirror of https://github.com/stashapp/stash.git
Convert scraped movie create data (#832)
This commit is contained in:
parent
94dc74f4a8
commit
c3a7d30a33
|
@ -11,6 +11,7 @@
|
||||||
* Re-show preview thumbnail when mousing away from scene card.
|
* Re-show preview thumbnail when mousing away from scene card.
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Fix error when creating movie from scene scrape dialog.
|
||||||
* Fix incorrect date timezone.
|
* Fix incorrect date timezone.
|
||||||
* Fix search filters not persisting for studios, markers and galleries.
|
* Fix search filters not persisting for studios, markers and galleries.
|
||||||
* Fix pending thumbnail on wall items on mobile platforms.
|
* Fix pending thumbnail on wall items on mobile platforms.
|
||||||
|
|
|
@ -18,6 +18,7 @@ import {
|
||||||
useTagCreate,
|
useTagCreate,
|
||||||
} from "src/core/StashService";
|
} from "src/core/StashService";
|
||||||
import { useToast } from "src/hooks";
|
import { useToast } from "src/hooks";
|
||||||
|
import { DurationUtils } from "src/utils";
|
||||||
|
|
||||||
function renderScrapedStudio(
|
function renderScrapedStudio(
|
||||||
result: ScrapeResult<string>,
|
result: ScrapeResult<string>,
|
||||||
|
@ -395,6 +396,20 @@ export const SceneScrapeDialog: React.FC<ISceneScrapeDialogProps> = (
|
||||||
let movieInput: GQL.MovieCreateInput = { name: "" };
|
let movieInput: GQL.MovieCreateInput = { name: "" };
|
||||||
try {
|
try {
|
||||||
movieInput = Object.assign(movieInput, toCreate);
|
movieInput = Object.assign(movieInput, toCreate);
|
||||||
|
|
||||||
|
// #788 - convert duration and rating to the correct type
|
||||||
|
movieInput.duration = DurationUtils.stringToSeconds(
|
||||||
|
toCreate.duration ?? undefined
|
||||||
|
);
|
||||||
|
if (!movieInput.duration) {
|
||||||
|
movieInput.duration = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
movieInput.rating = parseInt(toCreate.rating ?? "0", 10);
|
||||||
|
if (!movieInput.rating || Number.isNaN(movieInput.rating)) {
|
||||||
|
movieInput.rating = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
const result = await createMovie({
|
const result = await createMovie({
|
||||||
variables: movieInput,
|
variables: movieInput,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue