aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Media
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Media')
-rw-r--r--src/lib/Media/Anime/cache.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/Media/Anime/cache.ts b/src/lib/Media/Anime/cache.ts
index e988f255..e1a711ca 100644
--- a/src/lib/Media/Anime/cache.ts
+++ b/src/lib/Media/Anime/cache.ts
@@ -2,6 +2,7 @@ import { get } from "svelte/store";
import anime from "$stores/anime";
import { mediaListCollection, Type } from "../../Data/AniList/media";
import lastPruneTimes from "$stores/lastPruneTimes";
+import settings from "$stores/settings";
import type {
AniListAuthorisation,
UserIdentity,
@@ -26,8 +27,19 @@ export const incrementMediaProgress = (
id: number,
progress: number | undefined,
user: AniListAuthorisation,
- callback: () => void,
+ callback: (skipped?: boolean) => void,
) => {
+ if (get(settings).debugDryRunMutations) {
+ console.log(
+ `[dry-run] SaveMediaListEntry(mediaId: ${id}, progress: ${
+ (progress || 0) + 1
+ }) skipped`,
+ );
+ callback(true);
+
+ return;
+ }
+
fetch("https://graphql.anilist.co", {
method: "POST",
headers: {
@@ -40,5 +52,5 @@ export const incrementMediaProgress = (
(progress || 0) + 1
}) { id } }`,
}),
- }).then(callback);
+ }).then(() => callback(false));
};