1.5.0.2-dev1-cpr-vcodex-steroids
π 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.