π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix: add comments
Prateek Sunal09cc48ae55ca
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dartindex cd916436d5..6ebb8ae3fb 100644--- a/mobile/apps/photos/lib/services/video_preview_service.dart+++ b/mobile/apps/photos/lib/services/video_preview_service.dart@@ -195,29 +195,43 @@ class VideoPreviewService {Future<StreamingStatus> getStatus() async {try {- // TODO: Should we consider all days we could have processed or last 60 daysawait _ensurePreviewIdsInitialized();+ // This will get us all the video files that are present on remote+ // and also that could be / have been skipped due to device+ // limitationsfinal files = await _getFiles(beginDate: null,onlyFilesWithLocalId: false,);+ // This is the total video files that have streamsfinal Set<int> totalProcessed = fileDataService.previewIds.keys.toSet();+ // Total: Total Remote video files owned - skipped video filesfinal Set<int> total = {};+ // Processed: All the video files that are processed within the totalfinal Set<int> processed = {};int skipped = 0;for (final file in files) {+ // If file is processed, then add it to specific setif (totalProcessed.contains(file.uploadedFileID)) {processed.add(file.uploadedFileID!);- } else if (file.pubMagicMetadata?.sv == 1) {+ }+ // Don't include files which are to be skipped anyways+ else if (file.pubMagicMetadata?.sv == 1) {skipped++;continue;}+ // Include the file to total settotal.add(file.uploadedFileID!);}+ // If total is empty then mark all as processed else compute the ratio+ // of processed files and total remote video files+ // netProcessedItems = processed / totalfinal double netProcessedItems =- total.isEmpty ? 0 : (processed.length / total.length).clamp(0, 1);+ total.isEmpty ? 1 : (processed.length / total.length).clamp(0, 1);++ // Store the data and return itfinal status = StreamingStatus(netProcessedItems,totalProcessed.length,