feat: update WatchingActions to mark watched items

This commit is contained in:
tapframe 2026-04-22 15:32:54 +05:30
parent 7295aaa4f5
commit db74bc6796
3 changed files with 17 additions and 3 deletions

2
MPVKit

@ -1 +1 @@
Subproject commit 0c01e295f078f8382edcd0bb5326412791084146 Subproject commit 97923266e43d52bbca33a911fd6a7f9a1bcf35cb

View file

@ -4,6 +4,7 @@ import com.nuvio.app.features.details.MetaDetails
import com.nuvio.app.features.details.MetaDetailsRepository import com.nuvio.app.features.details.MetaDetailsRepository
import com.nuvio.app.features.details.MetaVideo import com.nuvio.app.features.details.MetaVideo
import com.nuvio.app.features.home.MetaPreview import com.nuvio.app.features.home.MetaPreview
import com.nuvio.app.features.watched.WatchedItem
import com.nuvio.app.features.watched.WatchedRepository import com.nuvio.app.features.watched.WatchedRepository
import com.nuvio.app.features.watched.episodePlaybackId import com.nuvio.app.features.watched.episodePlaybackId
import com.nuvio.app.features.watched.releasedPlayableEpisodes import com.nuvio.app.features.watched.releasedPlayableEpisodes
@ -106,7 +107,20 @@ object WatchingActions {
} }
fun onProgressEntryUpdated(entry: WatchProgressEntry) { fun onProgressEntryUpdated(entry: WatchProgressEntry) {
if (!entry.isCompleted || !entry.isEpisode) return if (!entry.isCompleted) return
val watchedItem = WatchedItem(
id = entry.parentMetaId,
type = entry.parentMetaType,
name = entry.title,
poster = entry.poster,
season = entry.seasonNumber,
episode = entry.episodeNumber,
markedAtEpochMs = entry.lastUpdatedEpochMs,
)
WatchedRepository.markWatched(watchedItem)
if (!entry.isEpisode) return
actionScope.launch { actionScope.launch {
val meta = runCatching { val meta = runCatching {
MetaDetailsRepository.fetch( MetaDetailsRepository.fetch(

View file

@ -1,3 +1,3 @@
CURRENT_PROJECT_VERSION=33 CURRENT_PROJECT_VERSION=34
MARKETING_VERSION=0.1.3 MARKETING_VERSION=0.1.3