Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: mostly all review comments

Prateek Sunal6ab2223a80e3
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dart
index 18a00f1de5..cd916436d5 100644
--- a/mobile/apps/photos/lib/services/video_preview_service.dart
+++ b/mobile/apps/photos/lib/services/video_preview_service.dart
@@ -112,6 +112,7 @@ class VideoPreviewService {
_items.clear();
}
+ // Return value indicates file was successfully added to queue or not
Future<bool> addToManualQueue(EnteFile file, String queueType) async {
if (file.uploadedFileID == null) return false;
@@ -139,23 +140,7 @@ class VideoPreviewService {
queueFiles(duration: Duration.zero);
}
- return true; // Indicates file was successfully added to queue
- }
-
- Future<void> removeFromManualQueue(int uploadedFileID) async {
- await UploadLocksDB.instance.removeFromStreamQueue(uploadedFileID);
- }
-
- Future<bool> isInManualQueue(int? uploadedFileID) async {
- if (uploadedFileID == null) return false;
-
- try {
- // Check database directly instead of relying on in-memory _manualQueueFiles
- // which might not be populated yet
- return await UploadLocksDB.instance.isInStreamQueue(uploadedFileID);
- } catch (_) {
- return false;
- }
+ return true;
}
bool isCurrentlyProcessing(int? uploadedFileID) {
@@ -565,7 +550,8 @@ class VideoPreviewService {
}
if (isInManualQueue) {
- await removeFromManualQueue(enteFile.uploadedFileID!);
+ await UploadLocksDB.instance
+ .removeFromStreamQueue(enteFile.uploadedFileID!);
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
index 5a978cc33c..1cf5f26fb0 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
@@ -6,6 +6,7 @@ import "package:flutter_svg/flutter_svg.dart";
import "package:local_auth/local_auth.dart";
import 'package:logging/logging.dart';
import 'package:media_extension/media_extension.dart';
+import "package:photos/core/configuration.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/guest_view_event.dart";
import "package:photos/generated/l10n.dart";
@@ -482,20 +483,24 @@ class FileAppBarState extends State<FileAppBar> {
bool _shouldShowCreateStreamOption() {
// Show "Create Stream" option for uploaded video files without streams
// Skip if sv=1 (server indicates streaming not needed)
+ final userId = Configuration.instance.getUserID();
return widget.file.fileType == FileType.video &&
widget.file.isUploaded &&
widget.file.uploadedFileID != null &&
(widget.file.pubMagicMetadata?.sv ?? 0) != 1 &&
+ widget.file.ownerID == userId &&
!fileDataService.previewIds.containsKey(widget.file.uploadedFileID!);
}
bool _shouldShowRecreateStreamOption() {
// Show "Recreate Stream" option for uploaded video files with existing streams
// Skip if sv=1 (server indicates streaming not needed)
+ final userId = Configuration.instance.getUserID();
return widget.file.fileType == FileType.video &&
widget.file.isUploaded &&
widget.file.uploadedFileID != null &&
(widget.file.pubMagicMetadata?.sv ?? 0) != 1 &&
+ widget.file.ownerID == userId &&
fileDataService.previewIds.containsKey(widget.file.uploadedFileID!);
}