Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: make uploadedFileID as the primary key

Prateek Sunal5a2be8652404
diff --git a/mobile/lib/db/upload_locks_db.dart b/mobile/lib/db/upload_locks_db.dart
index 32ff836402..f2aca98a56 100644
--- a/mobile/lib/db/upload_locks_db.dart
+++ b/mobile/lib/db/upload_locks_db.dart
@@ -47,7 +47,6 @@ class UploadLocksDB {
static const _streamUploadErrorTable = (
table: "stream_upload_error",
- columnID: "id",
columnUploadedFileID: "uploaded_file_id",
columnErrorMessage: "error_message",
columnLastAttemptedAt: "last_attempted_at",
@@ -129,8 +128,7 @@ class UploadLocksDB {
''',
'''
CREATE TABLE IF NOT EXISTS ${_streamUploadErrorTable.table} (
- ${_streamUploadErrorTable.columnID} INTEGER PRIMARY KEY,
- ${_streamUploadErrorTable.columnUploadedFileID} INTEGER NOT NULL,
+ ${_streamUploadErrorTable.columnUploadedFileID} INTEGER PRIMARY KEY,
${_streamUploadErrorTable.columnErrorMessage} TEXT NOT NULL,
${_streamUploadErrorTable.columnLastAttemptedAt} INTEGER NOT NULL,
${_streamUploadErrorTable.columnCreatedAt} INTEGER DEFAULT CURRENT_TIMESTAMP NOT NULL
diff --git a/mobile/lib/services/preview_video_store.dart b/mobile/lib/services/preview_video_store.dart
index 47463ef6e3..98637776bf 100644
--- a/mobile/lib/services/preview_video_store.dart
+++ b/mobile/lib/services/preview_video_store.dart
@@ -677,6 +677,7 @@ class PreviewVideoStore {
final cutoff = videoStreamingCutoff;
if (cutoff == null) return;
+ initSuccess = true;
Map<int, String> failureFiles = {};
try {
@@ -752,13 +753,14 @@ class PreviewVideoStore {
// take first file and put it for stream generation
final file = allFiles.removeAt(0);
fileQueue.addAll(allFiles);
- initSuccess = true;
- await chunkAndUploadVideo(null, file);
+ chunkAndUploadVideo(null, file).ignore();
}
void queueFiles() {
if (!initSuccess) {
- _putFilesForPreviewCreation();
+ _putFilesForPreviewCreation().catchError((_) {
+ initSuccess = false;
+ });
}
}
}