Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into independent
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 committed Dec 4, 2023
2 parents f930b94 + 0e26e15 commit aee247e
Show file tree
Hide file tree
Showing 66 changed files with 695 additions and 232 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ analyzer:
cancel_subscriptions: error


unawaited_futures: ignore # convert to warning after fixing existing issues
unawaited_futures: warning # convert to warning after fixing existing issues
invalid_dependency: info
use_build_context_synchronously: ignore # experimental lint, requires many changes
prefer_interpolation_to_compose_strings: ignore # later too many warnings
Expand Down
2 changes: 1 addition & 1 deletion lib/core/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class Configuration {
SearchService.instance.clearCache();
Bus.instance.fire(UserLoggedOutEvent());
} else {
_preferences.setBool("auto_logout", true);
await _preferences.setBool("auto_logout", true);
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/core/error-reporting/super_logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class SuperLogging {
await setupLogDir();
}
if (sentryIsEnabled) {
setupSentry();
setupSentry().ignore();
}

Logger.root.level = Level.ALL;
Expand Down Expand Up @@ -266,7 +266,7 @@ class SuperLogging {

// add error to sentry queue
if (sentryIsEnabled && rec.error != null) {
_sendErrorToSentry(rec.error!, null);
_sendErrorToSentry(rec.error!, null).ignore();
}
}

Expand Down Expand Up @@ -303,7 +303,7 @@ class SuperLogging {
static Future<void> setupSentry() async {
await for (final error in sentryQueueControl.stream.asBroadcastStream()) {
try {
Sentry.captureException(
await Sentry.captureException(
error,
);
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions lib/db/file_updation_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FileUpdationDB {
static const tableName = 're_upload_tracker';
static const columnLocalID = 'local_id';
static const columnReason = 'reason';
static const livePhotoSize = 'livePhotoSize';

static const modificationTimeUpdated = 'modificationTimeUpdated';

Expand Down
29 changes: 25 additions & 4 deletions lib/db/files_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ class FilesDB {
return uploadedFileIDs;
}

Future<EnteFile?> getUploadedLocalFileInAnyCollection(
Future<List<EnteFile>> getFilesInAllCollection(
int uploadedFileID,
int userID,
) async {
Expand All @@ -802,12 +802,11 @@ class FilesDB {
userID,
uploadedFileID,
],
limit: 1,
);
if (results.isEmpty) {
return null;
return <EnteFile>[];
}
return convertToFiles(results)[0];
return convertToFiles(results);
}

Future<Set<String>> getExistingLocalFileIDs(int ownerID) async {
Expand Down Expand Up @@ -1450,6 +1449,28 @@ class FilesDB {
return result;
}

// For a given userID, return unique uploadedFileId for the given userID
Future<List<String>> getLivePhotosWithBadSize(
int userId,
int sizeInBytes,
) async {
final db = await instance.database;
final rows = await db.query(
filesTable,
columns: [columnLocalID],
distinct: true,
where: '$columnOwnerID = ? AND '
'($columnFileSize IS NULL OR $columnFileSize = ?) AND '
'$columnFileType = ? AND $columnLocalID IS NOT NULL',
whereArgs: [userId, sizeInBytes, getInt(FileType.livePhoto)],
);
final result = <String>[];
for (final row in rows) {
result.add(row[columnLocalID] as String);
}
return result;
}

// updateSizeForUploadIDs takes a map of upploadedFileID and fileSize and
// update the fileSize for the given uploadedFileID
Future<void> updateSizeForUploadIDs(
Expand Down
84 changes: 80 additions & 4 deletions lib/generated/intl/messages_nl.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/generated/intl/messages_zh.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aee247e

Please sign in to comment.