Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: bypass size/duration limits for manual video stream requests

Prateek Sunal04aaa3a5e4c7
diff --git a/mobile/apps/photos/lib/services/video_preview_service.dart b/mobile/apps/photos/lib/services/video_preview_service.dart
index dc46e3db57..929df89ae3 100644
--- a/mobile/apps/photos/lib/services/video_preview_service.dart
+++ b/mobile/apps/photos/lib/services/video_preview_service.dart
@@ -299,7 +299,7 @@ class VideoPreviewService {
"Starting video preview generation for ${enteFile.displayName}",
);
// elimination case for <=10 MB with H.264
- var (props, result, file) = await _checkFileForPreviewCreation(enteFile);
+ var (props, result, file) = await _checkFileForPreviewCreation(enteFile, isManual);
if (result) {
removeFile = true;
return;
@@ -922,8 +922,9 @@ class VideoPreviewService {
}
Future<(FFProbeProps?, bool, File?)> _checkFileForPreviewCreation(
- EnteFile enteFile,
- ) async {
+ EnteFile enteFile, [
+ bool isManual = false,
+ ]) async {
if ((enteFile.pubMagicMetadata?.sv ?? 0) == 1) {
_logger.info("Skip Preview due to sv=1 for ${enteFile.displayName}");
return (null, true, null);
@@ -936,7 +937,7 @@ class VideoPreviewService {
}
final int size = enteFile.fileSize!;
final int duration = enteFile.duration!;
- if (size >= 500 * 1024 * 1024 || duration > 60) {
+ if (!isManual && (size >= 500 * 1024 * 1024 || duration > 60)) {
_logger.info("Skip Preview due to size: $size or duration: $duration");
return (null, true, null);
}