feat(playback): sync offline positions with Jellyfin

Add a home refresh side effect that compares offline progress with Jellyfin user data and syncs the furthest playback position.

Use Jellyfin playbackPositionTicks for server updates while keeping percent-based writes for local offline and in-memory repositories.
This commit is contained in:
2026-06-05 14:57:20 +00:00
parent 448550b5ab
commit 85c53f8704
8 changed files with 214 additions and 6 deletions

View File

@@ -72,6 +72,11 @@ class CompositeLocalMediaRepository @Inject constructor(
offlineRepository.updateWatchProgress(mediaId, positionMs, durationMs)
}
override suspend fun updateWatchProgressPercent(mediaId: UUID, progressPercent: Double) {
onlineRepository.updateWatchProgressPercent(mediaId, progressPercent)
offlineRepository.updateWatchProgressPercent(mediaId, progressPercent)
}
override suspend fun markAsWatched(mediaId: UUID, watched: Boolean) {
val repository = onlineRepository
repository.markAsWatched(mediaId, watched)

View File

@@ -4,5 +4,6 @@ import java.util.UUID
interface LocalMediaUpdater {
suspend fun updateWatchProgress(mediaId: UUID, positionMs: Long, durationMs: Long)
suspend fun updateWatchProgressPercent(mediaId: UUID, progressPercent: Double)
suspend fun markAsWatched(mediaId: UUID, watched: Boolean)
}