fix(home): keep finished series off the Continue-reading shelf
A "Continue reading" shelf listing series the reader already finished (read to the last page, nothing new) is odd. Expose the last-read chapter's page_count on the read-progress list, and filter the shelf to drop entries that are caught up (on the last page of the latest chapter with no new chapters). Mid-chapter and has-new-chapters entries stay; the full history view is unaffected. Finished detection is a pure, unit-tested helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,11 @@ pub struct ReadProgressSummary {
|
||||
/// `None` when the chapter was deleted after this row was written
|
||||
/// (FK ON DELETE SET NULL on `chapter_id`).
|
||||
pub chapter_number: Option<i32>,
|
||||
/// Page count of the last-read chapter (`None` when unknown / deleted).
|
||||
/// Lets a client distinguish a finished series (read to the last page,
|
||||
/// nothing new) from one still in progress — e.g. to keep finished
|
||||
/// series off a "Continue reading" shelf.
|
||||
pub chapter_page_count: Option<i32>,
|
||||
pub page: i32,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
/// How many chapters sit past the reader's last-read chapter (by
|
||||
|
||||
@@ -141,6 +141,7 @@ pub async fn list_for_user(
|
||||
m.cover_image_path AS manga_cover_image_path,
|
||||
rp.chapter_id,
|
||||
c.number AS chapter_number,
|
||||
c.page_count AS chapter_page_count,
|
||||
rp.page,
|
||||
rp.updated_at,
|
||||
-- Personal "new since last read": how many distinct chapter
|
||||
|
||||
Reference in New Issue
Block a user