Repository navigation
fix: Keep reading statistics when migrating to another source - #138
Open
PoonHarpoon wants to merge 1 commit into
Open
PoonHarpoon wants to merge 1 commit into
PoonHarpoon wants to merge 1 commit into
Conversation
Migration moved favourites, history and tracking to the new manga id but left the stats rows on the old one, so the migrated title showed no reading time and the rows were lost once the old history was purged. Move them along with the history. Fixes AppFuton#127
Collaborator
Author
|
Confirmed working |
PoonHarpoon
marked this pull request as ready for review
November 5, 2026 19:31
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.
Fixes #127
Important because this could be worse with #137
Migrating a title moved its favorites, history and tracking to the new manga id, but not its reading stats. The
statsrows stayed on the old id, so the migrated title showed no reading time, and the rows were deleted for good once the old history was purged.StatsDao.move()now reassigns them, inside the same transaction as the history move. It usesUPDATE OR IGNORE, so if the new title already has a session with the same start time, that row stays on the old id instead of making the migration fail.#137 adds single and batch source replacement on top of
MigrateUseCase, so without this a batch migration would reset stats for many titles at once.Tests pass but I have not tested on device yet.