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
@@ -246,12 +246,19 @@ struct TitleView: View {
|
||||
HStack(spacing: 0) {
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
HStack(spacing: 8) {
|
||||
ForEach(Array(title.seasons.enumerated()), id: \.element.label) { index, entry in
|
||||
// By position: two seasons can share a label.
|
||||
ForEach(Array(title.seasons.enumerated()), id: \.offset) { index, entry in
|
||||
FilterChip(label: entry.label, selected: index == seasonIndex) { seasonIndex = index }
|
||||
}
|
||||
}
|
||||
}
|
||||
if let season {
|
||||
// For someone joining the show partway, who would otherwise
|
||||
// tick every earlier episode one by one.
|
||||
let seen = season.episodes.allSatisfy(\.watched)
|
||||
IconButton(seen ? "checkmark.circle.badge.xmark" : "checkmark.circle", "Mark \(season.label) \(seen ? "unwatched" : "watched")") {
|
||||
model.markEpisodes(season.episodes, !seen, "\(title.displayName) \(season.label)")
|
||||
}
|
||||
IconButton("arrow.down.circle", "Download \(season.label)") {
|
||||
DownloadCoordinator.shared.enqueue(season.episodes)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user