mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +01:00
feat(android,ios): mark a whole season watched from the title page
Marking was one episode at a time on the title page, or the whole title from the library's long-press menu, so joining a show at season three meant ticking every earlier episode. The season row gains a mark button beside its download one, with an Undo, through a new markEpisodes that setTitleWatched now uses too. Episodes already in the asked-for state are left alone, so Undo restores only what changed. Season chips were keyed by label, and two seasons with one label is a crash in a lazy list; they are keyed by position now.
This commit is contained in:
1 parent
6d1943f2bd
commit
01c252b794
8 files changed
+44
-8
No files matched your search
@@ -484,8 +484,15 @@ final class AppModel {
|
||||
/// title's positions are what this throws away, and a mis-tap on a tile's
|
||||
/// menu should not cost them.
|
||||
func setTitleWatched(_ title: TitleRecord, _ watched: Bool) {
|
||||
showWatched(title.playlist, watched)
|
||||
changeWatch(title.playlist, "\(title.displayName) marked \(watched ? "watched" : "unwatched")") { engine, episode, before in
|
||||
markEpisodes(title.playlist, watched, title.displayName)
|
||||
}
|
||||
|
||||
/// Some episodes seen or unseen — a season, or a whole title — with an
|
||||
/// Undo; `what` names them in the message.
|
||||
func markEpisodes(_ episodes: [EpisodeRecord], _ watched: Bool, _ what: String) {
|
||||
let episodes = episodes.filter { $0.watched != watched }
|
||||
showWatched(episodes, watched)
|
||||
changeWatch(episodes, "\(what) marked \(watched ? "watched" : "unwatched")") { engine, episode, before in
|
||||
let duration = before?.durationSecs
|
||||
try engine.saveWatchState(
|
||||
shareId: episode.shareId,
|
||||
|
||||
Reference in new issue
Block a user