mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-04 00:47:00 +01:00
feat(android,ios): play from Downloads, and say what a download waits for
- A finished download row on the phones plays when tapped and has an Open button for its title, as the desktop's does. - iOS queued downloads say "Waiting for Wi-Fi" or "Waiting for a connection", as Android's already do. - Android download workers post their notifications as one group, each named for its episode, under a "Downloading 12 episodes" summary. Before, a season made fourteen loose notifications that all said "Making episode available offline".
This commit is contained in:
1 parent
5c0519a226
commit
5b931111b3
9 files changed
+142
-19
No files matched your search
@@ -19,6 +19,11 @@ final class DownloadCoordinator {
|
||||
/// Every retained download, sorted by label. Re-read after each write.
|
||||
private(set) var records: [RetainedDownload] = []
|
||||
|
||||
/// Why a queued download is not running, when it is not merely a free
|
||||
/// slot: a Wi-Fi-only download on mobile data waits without a word, and
|
||||
/// "Queued" for an hour on the bus reads as stuck.
|
||||
private(set) var queueReason: String?
|
||||
|
||||
/// A download finished or was removed: the catalog has changed.
|
||||
@ObservationIgnored var onFinished: (() -> Void)?
|
||||
|
||||
@@ -125,6 +130,10 @@ final class DownloadCoordinator {
|
||||
/// Re-apply "Wi-Fi only" to what is queued and running: a season queued
|
||||
/// before the setting was turned on must not then download over cellular.
|
||||
func applyNetworkPolicy() {
|
||||
queueReason = switch path?.status {
|
||||
case .satisfied?: allowed ? nil : "Waiting for Wi-Fi"
|
||||
default: "Waiting for a connection"
|
||||
}
|
||||
if allowed {
|
||||
resumeQueued()
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user