fix(anilist): pass fresh time-pos to post-watch threshold check

- Thread live mpv time-position through to AniList watched-seconds check
- Prevents missed progress updates when the cached value lags behind playback
This commit is contained in:
2026-05-16 17:48:55 -07:00
parent a36e628512
commit 215e0f804b
8 changed files with 86 additions and 8 deletions
+5 -1
View File
@@ -18,6 +18,7 @@ type RetryQueueItem = {
type AnilistPostWatchRunOptions = {
force?: boolean;
watchedSeconds?: number;
};
export function buildAnilistAttemptKey(mediaKey: string, episode: number): string {
@@ -146,7 +147,10 @@ export function createMaybeRunAnilistPostWatchUpdateHandler(deps: {
let watchedSeconds = 0;
if (!force) {
watchedSeconds = deps.getWatchedSeconds();
watchedSeconds =
typeof options.watchedSeconds === 'number' && Number.isFinite(options.watchedSeconds)
? options.watchedSeconds
: deps.getWatchedSeconds();
if (!Number.isFinite(watchedSeconds) || watchedSeconds < deps.minWatchSeconds) {
return;
}