Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain remote last chapter read if it's higher than the local one for EnhancedTracker #1301

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

brewkunz
Copy link
Contributor

@brewkunz brewkunz commented Oct 7, 2024

This PR is related to #1298.

When adding an item to the library, with the #1298 fix, the track's last_read_chapter value set by SyncChapterProgressWithTrack is always set to the local last read chapter.
This fix uses the max between the local and remote last read chapter to set its new value.

Comment on lines +40 to +41
val lastRead = max(remoteTrack.lastChapterRead, localLastRead.toDouble())
val updatedTrack = remoteTrack.copy(lastChapterRead = lastRead)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to update the tracker in db given local one is less

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually nvm. Keep it as is

@AntsyLich AntsyLich changed the title Fix last_chapter_read value when binding to an enhanced tracker Retain remote last chapter read if it's higher than the local one for EnhancedTracker Oct 10, 2024
@AntsyLich AntsyLich merged commit 44aab7a into mihonapp:main Oct 10, 2024
1 check passed
cuong-tran pushed a commit to komikku-app/komikku that referenced this pull request Oct 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants