From db74bc67968e0752583875b62255cbd679497597 Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Wed, 22 Apr 2026 15:32:54 +0530 Subject: [PATCH] feat: update WatchingActions to mark watched items --- MPVKit | 2 +- .../watching/application/WatchingActions.kt | 16 +++++++++++++++- iosApp/Configuration/Version.xcconfig | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/MPVKit b/MPVKit index 0c01e295..97923266 160000 --- a/MPVKit +++ b/MPVKit @@ -1 +1 @@ -Subproject commit 0c01e295f078f8382edcd0bb5326412791084146 +Subproject commit 97923266e43d52bbca33a911fd6a7f9a1bcf35cb diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/watching/application/WatchingActions.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/watching/application/WatchingActions.kt index 2482b800..4a79954e 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/watching/application/WatchingActions.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/watching/application/WatchingActions.kt @@ -4,6 +4,7 @@ import com.nuvio.app.features.details.MetaDetails import com.nuvio.app.features.details.MetaDetailsRepository import com.nuvio.app.features.details.MetaVideo 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.episodePlaybackId import com.nuvio.app.features.watched.releasedPlayableEpisodes @@ -106,7 +107,20 @@ object WatchingActions { } 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 { val meta = runCatching { MetaDetailsRepository.fetch( diff --git a/iosApp/Configuration/Version.xcconfig b/iosApp/Configuration/Version.xcconfig index c812d372..5f2f0caf 100644 --- a/iosApp/Configuration/Version.xcconfig +++ b/iosApp/Configuration/Version.xcconfig @@ -1,3 +1,3 @@ -CURRENT_PROJECT_VERSION=33 +CURRENT_PROJECT_VERSION=34 MARKETING_VERSION=0.1.3