π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
refactor: simplify StreamingStatus handling in VideoPreviewService
Prateek Sunalad2a0ce89738
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dartindex b8ec7ae159..f5da7d55b6 100644--- a/mobile/apps/photos/lib/services/video_preview_service.dart+++ b/mobile/apps/photos/lib/services/video_preview_service.dart@@ -43,23 +43,6 @@ import "package:shared_preferences/shared_preferences.dart";const _maxRetryCount = 3;-class StreamingStatus {- final double netProcessedItems;- final int processed;- final int total;-- StreamingStatus(- this.netProcessedItems,- this.processed,- this.total,- );-- @override- String toString() {- return 'StreamingStatus{netProcessedItems: $netProcessedItems, processed: $processed, total: $total}';- }-}-class VideoPreviewService {final _logger = Logger("VideoPreviewService");final LinkedHashMap<int, PreviewItem> _items = LinkedHashMap();@@ -191,7 +174,7 @@ class VideoPreviewService {);}- Future<StreamingStatus> getStatus() async {+ Future<double> getStatus() async {try {await _ensurePreviewIdsInitialized();// This will get us all the video files that are present on remote@@ -228,11 +211,7 @@ class VideoPreviewService {total.isEmpty ? 1 : (processed.length / total.length).clamp(0, 1);// Store the data and return it- final status = StreamingStatus(- netProcessedItems,- totalProcessed.length,- files.length,- );+ final status = netProcessedItems;return status;} catch (e, s) {_logger.severe('Error getting Streaming status', e, s);diff --git a/mobile/apps/photos/lib/ui/settings/streaming/video_streaming_settings_page.dart b/mobile/apps/photos/lib/ui/settings/streaming/video_streaming_settings_page.dartindex aa970f31cd..865c126c64 100644--- a/mobile/apps/photos/lib/ui/settings/streaming/video_streaming_settings_page.dart+++ b/mobile/apps/photos/lib/ui/settings/streaming/video_streaming_settings_page.dart@@ -259,7 +259,7 @@ class VideoStreamingStatusWidgetStatefuture: VideoPreviewService.instance.getStatus(),builder: (context, snapshot) {if (snapshot.hasData) {- final double netProcessed = snapshot.data!.netProcessedItems;+ final double netProcessed = snapshot.data!;return Column(crossAxisAlignment: CrossAxisAlignment.start,