ente/mobile/lib/events/sync_status_update_event.dart

39 lines
803 B
Dart
Raw Normal View History

2023-03-13 04:54:57 +00:00
import "package:logging/logging.dart";
2020-11-12 16:32:10 +00:00
import 'package:photos/events/event.dart';
class SyncStatusUpdate extends Event {
2023-03-13 04:54:57 +00:00
static final _logger = Logger("SyncStatusUpdate");
2020-11-15 07:19:51 +00:00
final SyncStatus status;
final int? completed;
final int? total;
final bool wasStopped;
2023-01-07 12:41:37 +00:00
@override
2020-11-16 16:35:16 +00:00
final String reason;
final Error? error;
late int timestamp;
2020-11-15 07:19:51 +00:00
SyncStatusUpdate(
this.status, {
this.completed,
this.total,
this.wasStopped = false,
2020-11-16 16:35:16 +00:00
this.reason = "",
this.error,
}) {
2023-03-13 04:54:57 +00:00
_logger.info("Creating sync status: " + status.toString());
2021-07-22 18:41:58 +00:00
timestamp = DateTime.now().microsecondsSinceEpoch;
}
}
2020-11-15 07:19:51 +00:00
enum SyncStatus {
2022-07-03 07:47:15 +00:00
startedFirstGalleryImport,
completedFirstGalleryImport,
applyingRemoteDiff,
preparingForUpload,
inProgress,
2020-11-16 16:35:16 +00:00
paused,
2022-07-03 07:47:15 +00:00
completedBackup,
2020-11-15 07:19:51 +00:00
error,
}