Repository navigation
fix: volume and part divider pages no longer count as chapters - #46
Merged
Merged
Conversation
Monte Cristo's "VOLUME TWO" ... "VOLUME FIVE" pages (just the heading) were numbered as chapters, so the reading-progress picker showed "Chapter 66. Matrimonial Projects" as 68 (reported by a reader, 2026-12-01). A Study in Scarlet's "PART I." pages did the same. story_chapters now leaves out a story section whose heading is Volume/Part/Book over less than SHORT_CHARS of text; a position stored on one reads as the chapter before it. Decided when the list is read, so existing libraries are corrected without reprocessing. Monte Cristo now has its 117 chapters, A Study in Scarlet its 14.
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.
A reader on The Count of Monte Cristo (added through Free classics) found every chapter number two too high: the reading-progress picker showed "Chapter 66. Matrimonial Projects" as 68.
Cause: the book's "VOLUME TWO" … "VOLUME FIVE" pages (each just the heading) are separate sections, classified as story and numbered as chapters. A Study in Scarlet's "PART I." / "PART II." pages did the same, so the sample book was off too.
Fix:
story_chaptersleaves out a story section whose heading starts with Volume/Part/Book and that has underSHORT_CHARS(500) characters of text. A "Part" that holds a whole chapter's text is still a chapter. A position stored on a divider reads as the chapter before it. It's decided when the list is read, so existing libraries are corrected without reprocessing.Verified on the real files: Monte Cristo (the exact Gutenberg EPUB on the server) now has 117 chapters, with 66 = Matrimonial Projects and 67 = The Office of the King's Attorney, matching the book. A Study in Scarlet has 14.
Tests: a new divider test, plus 186 tests across reading position, matter, recaps and KOSync.