|
@@ -16,6 +16,7 @@ import 'package:photos/events/subscription_purchased_event.dart';
|
|
|
import 'package:photos/events/sync_status_update_event.dart';
|
|
|
import 'package:photos/events/trigger_logout_event.dart';
|
|
|
import 'package:photos/models/backup_status.dart';
|
|
|
+import 'package:photos/models/duplicate_files.dart';
|
|
|
import 'package:photos/models/file_type.dart';
|
|
|
import 'package:photos/services/local_sync_service.dart';
|
|
|
import 'package:photos/services/notification_service.dart';
|
|
@@ -183,6 +184,23 @@ class SyncService {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Future<DuplicateFiles> getDuplicateFiles() async {
|
|
|
+ try {
|
|
|
+ final response = await _dio.get(
|
|
|
+ Configuration.instance.getHttpEndpoint() + "/files/duplicates",
|
|
|
+ options: Options(
|
|
|
+ headers: {
|
|
|
+ "X-Auth-Token": Configuration.instance.getToken(),
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ return DuplicateFiles.fromMap(response.data);
|
|
|
+ } catch (e) {
|
|
|
+ _logger.severe(e);
|
|
|
+ rethrow;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Future<BackupStatus> getBackupStatus() async {
|
|
|
final ids = await FilesDB.instance.getBackedUpIDs();
|
|
|
final size = await _getFileSize(ids.uploadedIDs);
|