fix: preserve watchlist progress on complete and status update

This commit is contained in:
2026-05-29 00:03:47 +02:00
committed by Milas Holsting
parent 9e8d479ce0
commit faf0a4db9f
2 changed files with 28 additions and 19 deletions

View File

@@ -41,11 +41,18 @@ func (s *watchlistService) UpdateEntry(ctx context.Context, userID string, anime
}
}
_, err = repo.UpsertWatchListEntry(txCtx, db.UpsertWatchListEntryParams{
ID: uuid.New().String(),
existing, _ := repo.GetWatchListEntry(txCtx, db.GetWatchListEntryParams{
UserID: userID,
AnimeID: animeID,
Status: status,
})
_, err = repo.UpsertWatchListEntry(txCtx, db.UpsertWatchListEntryParams{
ID: uuid.New().String(),
UserID: userID,
AnimeID: animeID,
Status: status,
CurrentEpisode: existing.CurrentEpisode,
CurrentTimeSeconds: existing.CurrentTimeSeconds,
})
return err
})