mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Don't bail on error when scraping all (#4442)
This commit is contained in:
@@ -24,6 +24,7 @@ import { useLocalForage } from "src/hooks/LocalForage";
|
||||
import { useToast } from "src/hooks/Toast";
|
||||
import { ConfigurationContext } from "src/hooks/Config";
|
||||
import { ITaggerSource, SCRAPER_PREFIX, STASH_BOX_PREFIX } from "./constants";
|
||||
import { errorToString } from "src/utils";
|
||||
|
||||
export interface ITaggerContextState {
|
||||
config: ITaggerConfig;
|
||||
@@ -293,21 +294,29 @@ export const TaggerContext: React.FC = ({ children }) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const results = await queryScrapeScene(currentSource.sourceInput, sceneID);
|
||||
let newResult: ISceneQueryResult;
|
||||
|
||||
if (results.error) {
|
||||
newResult = { error: results.error.message };
|
||||
} else if (results.errors) {
|
||||
newResult = { error: results.errors.toString() };
|
||||
} else {
|
||||
newResult = {
|
||||
results: results.data.scrapeSingleScene.map((r) => ({
|
||||
...r,
|
||||
// scenes are already resolved if they are scraped via fragment
|
||||
resolved: true,
|
||||
})),
|
||||
};
|
||||
try {
|
||||
const results = await queryScrapeScene(
|
||||
currentSource.sourceInput,
|
||||
sceneID
|
||||
);
|
||||
|
||||
if (results.error) {
|
||||
newResult = { error: results.error.message };
|
||||
} else if (results.errors) {
|
||||
newResult = { error: results.errors.toString() };
|
||||
} else {
|
||||
newResult = {
|
||||
results: results.data.scrapeSingleScene.map((r) => ({
|
||||
...r,
|
||||
// scenes are already resolved if they are scraped via fragment
|
||||
resolved: true,
|
||||
})),
|
||||
};
|
||||
}
|
||||
} catch (err: unknown) {
|
||||
newResult = { error: errorToString(err) };
|
||||
}
|
||||
|
||||
setSearchResults((current) => {
|
||||
|
||||
Reference in New Issue
Block a user