|
@@ -118,12 +118,15 @@ class SyncService {
|
|
}
|
|
}
|
|
|
|
|
|
Future<void> _doSync() async {
|
|
Future<void> _doSync() async {
|
|
|
|
+ final existingLocalFileIDs = await _db.getExistingLocalFileIDs();
|
|
|
|
+ final syncStartTime = DateTime.now().microsecondsSinceEpoch;
|
|
final result = await PhotoManager.requestPermission();
|
|
final result = await PhotoManager.requestPermission();
|
|
if (!result) {
|
|
if (!result) {
|
|
_logger.severe("Did not get permission");
|
|
_logger.severe("Did not get permission");
|
|
|
|
+ await _prefs.setInt(_dbUpdationTimeKey, syncStartTime);
|
|
|
|
+ await FileRepository.instance.reloadFiles();
|
|
|
|
+ return await syncWithRemote();
|
|
}
|
|
}
|
|
- final existingLocalFileIDs = await _db.getExistingLocalFileIDs();
|
|
|
|
- final syncStartTime = DateTime.now().microsecondsSinceEpoch;
|
|
|
|
final lastDBUpdationTime = _prefs.getInt(_dbUpdationTimeKey);
|
|
final lastDBUpdationTime = _prefs.getInt(_dbUpdationTimeKey);
|
|
if (lastDBUpdationTime != null && lastDBUpdationTime != 0) {
|
|
if (lastDBUpdationTime != null && lastDBUpdationTime != 0) {
|
|
await _loadAndStorePhotos(
|
|
await _loadAndStorePhotos(
|
|
@@ -141,6 +144,7 @@ class SyncService {
|
|
}
|
|
}
|
|
await _loadAndStorePhotos(startTime, syncStartTime, existingLocalFileIDs);
|
|
await _loadAndStorePhotos(startTime, syncStartTime, existingLocalFileIDs);
|
|
}
|
|
}
|
|
|
|
+ await FileRepository.instance.reloadFiles();
|
|
await syncWithRemote();
|
|
await syncWithRemote();
|
|
}
|
|
}
|
|
|
|
|