import type { ReadProgressSummary } from '$lib/api/read_progress'; // Whether a read-progress entry has nothing left to continue: the reader is // on the last page of the latest chapter and no newer chapters exist. Such // finished series are kept off the homepage "Continue reading" shelf (the // full history view still shows them). export function isCaughtUp( e: Pick< ReadProgressSummary, 'new_chapters_count' | 'chapter_number' | 'chapter_page_count' | 'page' > ): boolean { return ( e.new_chapters_count === 0 && e.chapter_number != null && e.chapter_page_count != null && e.chapter_page_count > 0 && e.page >= e.chapter_page_count ); }