mirror of
https://github.com/narrrl/proton-stream.git
synced 2026-11-03 16:41:26 +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
@@ -327,9 +327,11 @@ func formatBytes(_ bytes: UInt64) -> String {
|
||||
}
|
||||
|
||||
/// One line under a download that has not finished: "Running · 120.0 MiB of
|
||||
/// 1.2 GiB · 2.4 MiB/s", or "Queued" while it waits for a slot.
|
||||
func downloadStatusLine(_ download: RetainedDownload) -> String {
|
||||
var parts = [download.status.prefix(1).uppercased() + download.status.dropFirst()]
|
||||
/// 1.2 GiB · 2.4 MiB/s", or "Queued" while it waits for a slot — or, given a
|
||||
/// `waitingFor`, what it is really waiting on.
|
||||
func downloadStatusLine(_ download: RetainedDownload, waitingFor: String? = nil) -> String {
|
||||
let status = download.status == RetainedDownload.statusQueued ? waitingFor : nil
|
||||
var parts = [status ?? download.status.prefix(1).uppercased() + download.status.dropFirst()]
|
||||
if download.total > 0, download.downloaded > 0 {
|
||||
parts.append("\(formatBytes(UInt64(download.downloaded))) of \(formatBytes(UInt64(download.total)))")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user