Skip to content

armgit / ente

Public Imported from GitHub
0

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

Only process files with known duration & size

Neeraj Guptac87b2b75422e
diff --git a/mobile/lib/db/files_db.dart b/mobile/lib/db/files_db.dart
index fb8cb72541..1d46bff519 100644
--- a/mobile/lib/db/files_db.dart
+++ b/mobile/lib/db/files_db.dart
@@ -1683,8 +1683,8 @@ class FilesDB with SqlDbBase {
AND $columnUploadedFileID != -1
AND $columnOwnerID = $userID
AND $columnLocalID IS NOT NULL
- AND ($columnFileSize IS NULL OR $columnFileSize <= 524288000)
- AND ($columnDuration IS NULL OR $columnDuration <= 60)
+ AND ($columnFileSize IS NOT NULL AND $columnFileSize <= 524288000)
+ AND ($columnDuration IS NOT NULL AND ($columnDuration <= 60 AND $columnDuration > 0))
ORDER BY $columnCreationTime DESC
''',
[getInt(fileType), beginDate.microsecondsSinceEpoch],
diff --git a/mobile/lib/services/preview_video_store.dart b/mobile/lib/services/preview_video_store.dart
index 5fcd4cb109..d01dda29a5 100644
--- a/mobile/lib/services/preview_video_store.dart
+++ b/mobile/lib/services/preview_video_store.dart
@@ -766,16 +766,8 @@ class PreviewVideoStore {
);
final previewIds = fileDataService.previewIds;
- final allFiles = files
- .where((file) => previewIds[file.uploadedFileID] == null)
- .sorted((a, b) {
- // put higher duration videos last along with remote files
- final first = (a.localID == null ? 2 : 0) +
- (a.duration == null || a.duration! >= 10 * 60 ? 1 : 0);
- final second = (b.localID == null ? 2 : 0) +
- (b.duration == null || b.duration! >= 10 * 60 ? 1 : 0);
- return first.compareTo(second);
- }).toList();
+ final allFiles =
+ files.where((file) => previewIds[file.uploadedFileID] == null).toList();
// set all video status to in queue
var n = allFiles.length, i = 0;