From 8d75528aa59f33bee5175a0e7e262f012f5595cf Mon Sep 17 00:00:00 2001 From: Prateek Sunal Date: Mon, 1 Sep 2025 23:35:08 +0530 Subject: [PATCH] fix: introduce in queue and creating stream two types of statuses --- .../lib/services/video_preview_service.dart | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dart index 4cbdc683fa..29d263cea5 100644 --- a/mobile/apps/photos/lib/services/video_preview_service.dart +++ b/mobile/apps/photos/lib/services/video_preview_service.dart @@ -157,7 +157,27 @@ class VideoPreviewService { bool isCurrentlyProcessing(int? uploadedFileID) { if (uploadedFileID == null) return false; - return uploadingFileId == uploadedFileID; + // Check if file is actively being processed + if (uploadingFileId == uploadedFileID) return true; + + // Also check if file is in queue or other processing states + final item = _items[uploadedFileID]; + if (item != null) { + switch (item.status) { + case PreviewItemStatus.inQueue: + case PreviewItemStatus.compressing: + case PreviewItemStatus.uploading: + return true; + default: + return false; + } + } + + return false; + } + + PreviewItemStatus? getProcessingStatus(int uploadedFileID) { + return _items[uploadedFileID]?.status; } Future _isRecreateOperation(EnteFile file) async { @@ -258,8 +278,9 @@ class VideoPreviewService { BuildContext? ctx, EnteFile enteFile, [ bool forceUpload = false, - bool isManual = false, ]) async { + final bool isManual = + await uploadLocksDB.isInStreamQueue(enteFile.uploadedFileID!); final canStream = _isPermissionGranted(); if (!canStream) { _logger.info(