-
Notifications
You must be signed in to change notification settings - Fork 481
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
Fix EnhancedTracker not auto binding when adding manga to library #1298
Fix EnhancedTracker not auto binding when adding manga to library #1298
Conversation
.filterIsInstance<EnhancedTracker>() | ||
.filter { it.accept(source) } | ||
.forEach { service -> | ||
try { | ||
service.match(manga)?.let { track -> | ||
track.manga_id = manga.id | ||
(service as Tracker).bind(track) | ||
insertTrack.await(track.toDomainTrack()!!) | ||
insertTrack.await(track.toDomainTrack(idRequired = false)!!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now needed since the track might not have an id yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the old implementation didn't need this (which actually did auto bind) either so should be fine? unless it was a issue during testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was indeed an issue during my tests. If the item you add to the library has no exisiting track with the tracker, the track has no id yet and toDomainTrack
throws an exception.
It seems like this method allows for inserting and updating, but when you are inserting you have to set this parameter to false.
Good job trying to fix your own issue |
Should be a separate PR |
38376e0
to
5df78cd
Compare
This PR is an attempt to fix the issue #306.
Tracking used to be enabled by default when adding an item to the library, which is not the case anymore.
This fix tries to bind with all logged In enhanced trackers upon adding an item to the library.
I think there still is an issue with the track being saved with alast_read_chapter
value of 0.0, but the problem seems to lie in theSyncChapterProgressWithTrack
and is not introduced by this fix.