github marcoand75/cpr-vcodex-steroids 1.5.0.2-dev1-cpr-vcodex-steroids

๐Ÿ“š Library Overhaul

  • ๐Ÿ”„ Complete library rewrite โ€” new fixed-record .dat index 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_index from EPUB metadata (fast ZIP-based parser)
  • ๐Ÿ“š EPUB3 belongs-to-collection fallback 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.


Don't miss a new cpr-vcodex-steroids release

NewReleases is sending notifications on new releases.