mirror of
https://github.com/bbara04/Purefin.git
synced 2026-07-23 19:26:50 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user