feat(android,ios): mark watched up to an episode, and undo an episode's tick

A long press on an episode row offers "Mark watched up to here", as a
right click on the desktop's tick does. It is for someone joining a show
partway. Ticking one episode now goes through the same path as a season,
so it gets the same Undo.
This commit is contained in:
nvrl committed 2026-10-13 15:48:59 +02:00
1 parent 5c15f45ace
commit 5c0519a226
4 files changed
+49 -39

No files matched your search

+2 -18
View File
@@ -737,25 +737,9 @@ final class AppModel {
/// Unwatching rewinds, matching the desktop client. Marking one seen puts
/// the position at its duration where one is known, so the progress bar
/// agrees with the tick.
/// One episode's tick, with the same Undo a season's has.
func setWatched(_ episode: EpisodeRecord, _ watched: Bool) {
showWatched([episode], watched)
Task {
do {
try await run { engine in
let duration = try engine.watchState(shareId: episode.shareId, linkId: episode.linkId)?.durationSecs
try engine.saveWatchState(
shareId: episode.shareId,
linkId: episode.linkId,
positionSecs: watched ? duration ?? 0 : 0,
durationSecs: duration,
watched: watched
)
}
} catch {
reportError(error)
}
reload()
}
markEpisodes([episode], watched, episode.label)
}
/// Draw a watched mark the moment it is tapped, before the bridge has