mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-04 17:16:50 +02:00
fix(downloads): hide unknown byte totals in notifications
This commit is contained in:
@@ -373,8 +373,11 @@ extension _DownloadQueueProgress on DownloadQueueNotifier {
|
||||
notifProgress = 0;
|
||||
notifTotal = 0;
|
||||
} else if (bytesTotal <= 0) {
|
||||
notifProgress = (progressPercent * 100).toInt();
|
||||
notifTotal = 100;
|
||||
notifTotal = PlatformBridge.notificationPercentTotal;
|
||||
notifProgress = (progressPercent * notifTotal)
|
||||
.round()
|
||||
.clamp(0, notifTotal)
|
||||
.toInt();
|
||||
}
|
||||
final serviceStatus = notifTotal <= 0 ? 'preparing' : 'downloading';
|
||||
|
||||
|
||||
@@ -145,6 +145,10 @@ class _BridgeInFlight<T> {
|
||||
}
|
||||
|
||||
class PlatformBridge {
|
||||
/// Sentinel shared with Android's foreground service for progress reports
|
||||
/// that contain a percentage but no byte counts.
|
||||
static const int notificationPercentTotal = 10000;
|
||||
|
||||
static const _channel = MethodChannel('com.zarz.spotiflac/backend');
|
||||
static const _jsonResultFileKey = '__json_file';
|
||||
static const _backgroundJsonDecodeThresholdBytes = 128 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user