[PR #15633] Add ProgressState field for precise EPUB location tracking #14368

Open
opened 2026-02-07 07:28:44 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/15633
Author: @bluesam1
Created: 11/26/2025
Status: 🔄 Open

Base: masterHead: feature/epub-progress-state


📝 Commits (1)

  • 72aeb28 Add ProgressState field for precise EPUB location tracking

📊 Changes

9 files changed (+1824 additions, -1 deletions)

View changed files

📝 Emby.Server.Implementations/Library/UserDataManager.cs (+9 -1)
📝 Emby.Server.Implementations/Session/SessionManager.cs (+7 -0)
📝 MediaBrowser.Controller/Entities/UserItemData.cs (+11 -0)
📝 MediaBrowser.Model/Dto/UpdateUserItemDataDto.cs (+10 -0)
📝 MediaBrowser.Model/Dto/UserItemDataDto.cs (+10 -0)
📝 MediaBrowser.Model/Session/PlaybackProgressInfo.cs (+11 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/UserData.cs (+14 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251125042610_AddProgressStateToUserData.Designer.cs (+1724 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251125042610_AddProgressStateToUserData.cs (+28 -0)

📄 Description

Summary

In order to make the 'Books' feature useful, this adds a generic string-based ProgressState field to support complex media position tracking that cannot be represented as simple ticks. Primary use case is EPUB CFI (Canonical Fragment Identifier) strings for precise ebook location resumption.

Problem

EPUB files use CFI strings (e.g., epubcfi(/6/4[chap01]!/4[body]/10[para05]/3:10)) to point to exact locations regardless of font size, screen width, or layout changes. The current PlaybackPositionTicks field only supports linear percentage values, causing users to lose their reading position when syncing across devices with different screen sizes.

Solution

  • Add ProgressState nullable string field to UserData database entity
  • Create EF Core migration for the new column
  • Extend DTOs (UserItemDataDto, UpdateUserItemDataDto, PlaybackProgressInfo) to include ProgressState
  • Update UserDataManager to map and persist ProgressState
  • Update SessionManager.OnPlaybackProgress to save ProgressState when provided

Changes

  • Database: Added ProgressState column to UserData table via EF Core migration
  • Models: Added ProgressState property to UserItemData, UserItemDataDto, UpdateUserItemDataDto, and PlaybackProgressInfo
  • Business Logic: Updated mapping and persistence logic in UserDataManager and SessionManager

Testing

  • Manual testing with EPUB files
  • Verified backward compatibility (existing items without ProgressState continue to work)
  • Database migration tested successfully

Complements frontend PR: jellyfin/jellyfin-web#7353 (Use ProgressState for precise EPUB location tracking)
Addresses the issue described in the feature proposal for native EPUB CFI support. jellyfin/jellyfin-web/issues/3791


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/15633 **Author:** [@bluesam1](https://github.com/bluesam1) **Created:** 11/26/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature/epub-progress-state` --- ### 📝 Commits (1) - [`72aeb28`](https://github.com/jellyfin/jellyfin/commit/72aeb283481f5873e6bda75ca9d1b20bf336660f) Add ProgressState field for precise EPUB location tracking ### 📊 Changes **9 files changed** (+1824 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/Library/UserDataManager.cs` (+9 -1) 📝 `Emby.Server.Implementations/Session/SessionManager.cs` (+7 -0) 📝 `MediaBrowser.Controller/Entities/UserItemData.cs` (+11 -0) 📝 `MediaBrowser.Model/Dto/UpdateUserItemDataDto.cs` (+10 -0) 📝 `MediaBrowser.Model/Dto/UserItemDataDto.cs` (+10 -0) 📝 `MediaBrowser.Model/Session/PlaybackProgressInfo.cs` (+11 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/UserData.cs` (+14 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251125042610_AddProgressStateToUserData.Designer.cs` (+1724 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20251125042610_AddProgressStateToUserData.cs` (+28 -0) </details> ### 📄 Description ## Summary In order to make the 'Books' feature useful, this adds a generic string-based `ProgressState` field to support complex media position tracking that cannot be represented as simple ticks. Primary use case is EPUB CFI (Canonical Fragment Identifier) strings for precise ebook location resumption. ## Problem EPUB files use CFI strings (e.g., `epubcfi(/6/4[chap01]!/4[body]/10[para05]/3:10)`) to point to exact locations regardless of font size, screen width, or layout changes. The current `PlaybackPositionTicks` field only supports linear percentage values, causing users to lose their reading position when syncing across devices with different screen sizes. ## Solution - Add `ProgressState` nullable string field to `UserData` database entity - Create EF Core migration for the new column - Extend DTOs (`UserItemDataDto`, `UpdateUserItemDataDto`, `PlaybackProgressInfo`) to include `ProgressState` - Update `UserDataManager` to map and persist `ProgressState` - Update `SessionManager.OnPlaybackProgress` to save `ProgressState` when provided ## Changes - **Database:** Added `ProgressState` column to `UserData` table via EF Core migration - **Models:** Added `ProgressState` property to `UserItemData`, `UserItemDataDto`, `UpdateUserItemDataDto`, and `PlaybackProgressInfo` - **Business Logic:** Updated mapping and persistence logic in `UserDataManager` and `SessionManager` ## Testing - Manual testing with EPUB files - Verified backward compatibility (existing items without `ProgressState` continue to work) - Database migration tested successfully ## Related Complements frontend PR: jellyfin/jellyfin-web#7353 (Use ProgressState for precise EPUB location tracking) Addresses the issue described in the feature proposal for native EPUB CFI support. jellyfin/jellyfin-web/issues/3791 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:28:44 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14368