๐ Library Overhaul
- ๐ Complete library rewrite โ new fixed-record
.datindex replaces JSON for unlimited scalability - ๐ Supports 3,000โ4,000+ books โ RAM usage is constant (~11 KB) regardless of library size
- ๐๏ธ Collections/Series support โ browse books by series extracted from Calibre and EPUB3 metadata
- ๐จ On-demand cover generation โ covers generated per-page with progress indicator, matching Home screen quality
- โก Fast e-ink navigation โ partial render optimisation for sub-second page navigation
- ๐ท๏ธ Ribbon badges โ favourite, completed, and recently-opened status shown on every tile
- ๐ Full-text search โ case-insensitive subtitle search across titles and authors
- ๐ 5 filter modes โ All, Favourites, Latest Read, Unread, Completed
- ๐ 4 grid layouts โ 2ร2, 3ร3, 4ร4 with auto-sizing covers and proper crop
- ๐พ Persistent state โ sort, filter, and search text survive device restarts
- ๐งน Rebuild Library โ one-tap full reset of all library data
๐ Collections/Series
- ๐ Extracts
calibre:series/calibre:series_indexfrom EPUB metadata (fast ZIP-based parser) - ๐ EPUB3
belongs-to-collectionfallback with group-position support - ๐งญ Browse collections list โ enter collection โ browse books in series order
- โฉ๏ธ Back navigation: collection โ collections list โ library exit
- ๐ท๏ธ Dedicated header labels:
Collections/Collection Name
๐ Bookmarks & Clippings (v4/v2)
- ๐ฏ Layout-independent positioning โ bookmarks and highlights survive font changes, margin adjustments, and orientation switches
- โจ Absolute word indexing โ each bookmark references a word by its position from chapter start, invariant across layout changes
- ๐ Word-accurate highlighting โ the exact bookmarked word is highlighted on screen regardless of current font or page layout
- ๐ฑ Dedicated browser apps โ BookmarksApp and ClippingsApp for browsing all marks across books
- ๐ Text clipping with selection โ directional key selection for start/end words, saved with chapter context
- โ๏ธ Long-press trigger โ configurable front-button long-press for bookmark or clipping mode
- ๐ก Inspired by CrossInk's approach โ reimagined with layout-independence for Xteink X4/X3
- ๐งน Bookmark persistence v4 โ stored in stable
bookdata/directory via BookIdentity hashing
๐ Upstream Sync
- ๐ Synced with CPR-vCodex 1.5.0.2 โ reading stats fixes, achievements hardening
- โฐ X3 clock support โ DS3231 RTC hardware clock with NTP sync (upstream HalClock)
- ๐ Reading statistics โ per-book and global stats with pace tracking (Steroids-enhanced)
- ๐ Achievements system โ reading streaks and milestones
- ๐ KOReader sync โ multi-profile credential store with sendMetadata and syncBehavior
- ๐ค Lexend SD font support โ moved from built-in to downloadable format
โก Performance & Stability
- ๐ง Constant RAM footprint โ library uses ~11 KB fixed, freeing ~40 KB from the old vector-based approach
- ๐๏ธ External merge-sort โ indices built in streaming K-way merge, never loaded entirely in memory
- ๐ซ Conrupt EPUB protection โ Guru Meditation crash eliminated, graceful failure on damaged files
- ๐พ Fixed-record storage โ 256-byte records with direct seek, no JSON parsing overhead
- ๐ผ๏ธ XTC 4ร4 cover fix โ increased source row buffer to handle small-thumbnail scaling
Detailed Implementation
Library Index System
The library now uses a fixed-length binary record format stored at /.crosspoint/LIBRARY/library.dat. Each record is exactly 256 bytes containing book ID, title (64 bytes), author (48 bytes), path (128 bytes), file size, flags (tombstone/favourite/opened/completed), modification time, and reserved padding. This replaces the previous JSON-based approach that loaded all entries into RAM.
Three index files enable fast lookups: idx_title.bin (sorted by accent-folded lowercase title), idx_author.bin (sorted by author), and idx_collections.bin (unique series/collection names). Indices are built using external K-way merge-sort with configurable chunk size (default 16 records), processing up to 10,000 books with constant RAM.
Collections are built from series.dat which stores per-book series metadata (Calibre series name + index, or EPUB3 collection name). The series.dat is sorted during build and indexed by unique collection name.
Cover Generation
When a page is displayed, the library iterates over visible slots and generates missing cover thumbnails using the full EPUB/XTC parser (same pipeline as the Home screen). Each generated cover triggers a full e-ink refresh so covers appear progressively. The progress text "3/9 Loading..." appears centered below the book author. Generation is blocked during navigation to prevent input conflicts. TXT/MD files are skipped (no cover support).
Collections/Series Extraction
The EPUB fast-parser (EpubParser::readDirectFromZip) now extracts series metadata from the OPF file without loading the full EPUB parser. It searches for <meta name="calibre:series" content="..."/> and <meta name="calibre:series_index" content="..."/> (Calibre format) with a fallback to EPUB3 belongs-to-collection and group-position refines. Both systems coexist with Calibre taking priority.
Layout-Independent Bookmarks
Bookmarks use an absolute word index system (v4) where each bookmark stores absoluteWordStart โ the cumulative word position from the chapter start. When the user changes font size, margins, or switches between simplified/integrated CSS modes, the section cache is rebuilt and buildCumulativeWordCounts() recalculates per-page word boundaries. The bookmark's absoluteWordStart is compared against pageStart + wordIndex to find and highlight the exact word in any layout.
Clippings (text highlights) use the same system (v2) with absoluteWordStart + wordCount representing a range of highlighted text. Both systems are stored in stable data directories via BookIdentity hashing to survive path changes.
Upstream CPR-vCodex Base
This release is built on CPR-vCodex 1.5.0.2 from franssjz/cpr-vcodex. The upstream provides: HalClock DS3231 RTC support, ClockSyncActivity with NTP, KOReader multi-profile sync with sendMetadata/syncBehavior, Unicode compose table, progressive EPUB indexing improvements, and various EPUB parser fixes. All Steroids customisations (library, collections, bookmarks, clippings, screensaver, browser settings, OTA branding) are preserved on top.