Conversation
…mikku (cherry picked from commit 704f6c8741c8573c914f144e9544870feee189d1)
|
I feel like this could be cleaner. Would something like this work?
|
|
I think both approaches would probably work. The soft deletion approach is comparatively easy to implement and propagates well though the existing sync process. At the same time it is fairly performant due to being built in the view (or it should, haven't tested that actually). On the other hand, using a storage table would allow the schema to remain closer to upstream and the handling of what is primarily a sync-problem would remain outside the general library code. I primarily see two difficulties with the separate table:
The last point is also the case for my approach since every migration that rebuilds the views for chapters also needs to take into account soft deletion. Edit: thank you for the really quick reply btw :) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…lessly piling on new entities
These are almost entirely AI generated, though I did check if they actually correctly test behavior.
|
Cherry picked some fixes and quickly tested those. Should be ready from my side! |
Solves the issue of "ghost chapters" reappearing after sync.
On many sources, chapters sometimes get replaced with other variants or just outright deleted. Currently, when that happens, the old chapters will be restored from the synchronization. This solves the issue by soft deleting removed chapters.
This way, when synchronizing, removed chapters will not be restored again and again since we aren't "forgetting" that they were purposefully removed. Otherwise it will think that, while comparing with remote, new chapters have been added even though those were just removed locally.
This is especially critical when some unnamed sources (you know who you are!) decide that all chapters are now different (except they aren't), creating new entities leading to duplicates everywhere.
I orignally wrote this for a PR I submitted to komikku and had that reviewed by @kaiserbh, but then forgot about also writing a PR for that here. Sorry about that 😅