Update onlyShowLaterBooksInContinueSeries to account for rereads#5120
Open
octopotato wants to merge 1 commit intoadvplyr:masterfrom
Open
Update onlyShowLaterBooksInContinueSeries to account for rereads#5120octopotato wants to merge 1 commit intoadvplyr:masterfrom
octopotato wants to merge 1 commit intoadvplyr:masterfrom
Conversation
…aterBooks is enabled The setting used max(sequence) to find where the user is in a series, so re-reading an earlier book had no effect on the continue-series position. Switched to ordering by finishedAt instead, with highest sequence as tiebreaker for batch mark-as-finished.
39cbc75 to
953dddb
Compare
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.
Brief summary
I updated the
onlyShowLaterBooksInContinueSeriesquery to use the most recently finished book's position instead of the highest finished sequence. This makes rereads actually move your continue-series position.Which issue is fixed?
I was going to open an issue but found #2687, where this was originally introduced, where it was called out that "this would not really help re-listeners." Figured I'd take a crack at that. Happy to open a separate/new issue for it.
In-depth Description
The
max(sequence)approach only ever goes forward, so rereading an earlier book has no effect on where continue-series picks up. If you finished books 1-5 and reread book 1, it still shows book 6.I switched the subquery to order by
finishedAt(withCOALESCEtoupdatedAtfor older records that might not have it) and grab the first result. So re-finishing book 1 gives you sequence 1, next book shown is 2.For batch mark-as-finished where everything gets the same
finishedAt, I added a sequence tiebreaker so it falls back to the highest sequence, basically the same as the old behavior.I also had to widen the
bookSeriesinclude to not filter out finished books when the setting is on, since after a reread the "next" book might be one you've already read.Default behavior (setting off) is untouched.
Not 100% sure if this should live behind a separate setting or if changing the existing one is fine. Happy to split it out if that's preferred.
How have you tested this?
Ran the server locally with the setting enabled and confirmed the reread scenario shows the right book. Also added integration tests.
Screenshots
Screen.Recording.2026-03-12.at.5.53.34.PM.mov