Repository navigation
Conversation
In "update" mode, existing anime and manga take the AniList values in place. An entry that matches AniList gets no write and no history record. A changed entry gets one history record dated with AniList's updatedAt. Missing media and repeats are created as in "new" mode, and nothing is deleted.
Add the mode to the import mode list and label it in scheduled imports. Imports from other sources fail in update mode with a clear message until they support it.
AlgusDark
marked this pull request as draft
November 6, 2026 13:27
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1800
Why
Periodic AniList imports have no mode that treats AniList as the source of truth. "Overwrite" deletes and recreates every entry, so undated entries show up in Activity History as added on every run. "New" only fills empty fields and moves status and progress forward, so a paused, dropped, or rescored entry never changes. This PR adds an "update" mode. It changes existing entries in place, only when AniList differs, and dates the change with AniList's
updatedAt.What changed
update_existing_mediaandupdate_existing_entriesinintegrations/imports/helpers.pysit beside their "new" mode counterparts. They compare status, progress, score, start date, end date, and notes, and set only the fields that differ. The history record gets AniList'supdatedAt, and so doesprogressed_atwhen progress changed. If Yamtrack already has a record at that time or later, the update is dated now, so the history page still diffs records in order. The rows go through the existingbulk_update_media, soMedia.save()never runs.AniListImporterloads existing entries in every mode except overwrite and calls the update helper in "update" mode. Missing media and missing repeats are created as in "new" mode, and nothing is deleted. The delete, create, and update writes now run in one transaction.import_mediaraises aMediaImportErrorwhen another importer gets "update", so the results page shows the reason.Scope
UPDATE_MODE_IMPORTERSinintegrations/tasks.py.repeat+ 1) than Yamtrack, the existing current entry becomes a finished repeat. It gets the Completed status, the episode or chapter count, and AniList's score and notes. It keeps its dates, because AniList only has the dates of the newest run. The missing entries are created after it. Yamtrack entries beyond AniList's count stay.Tradeoffs
Verification
uv run manage.py test app users integrations lists eventsran 882 tests, including 7 new ones, with Playwright Chromium installed. 881 pass. The one failure is an OpenLibrary metadata test that passes alone and flakes the same way ondev.ruff checkandruff format --checkpass.updatedAt.==score comparison fails the no-history test, becauseDecimal("7.3") != 7.3. The new history-date, transaction, and update-path tests each fail when their code is removed.