mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Don't reload files if nothing changes in remote sync
This commit is contained in:
parent
def24946e2
commit
177d3c51fb
1 changed files with 8 additions and 4 deletions
|
@ -90,9 +90,10 @@ class FilesController {
|
||||||
|
|
||||||
_c.touchManager.clearTouchCache();
|
_c.touchManager.clearTouchCache();
|
||||||
final progress = IntProgress(account.roots.length);
|
final progress = IntProgress(account.roots.length);
|
||||||
|
var hasChange = false;
|
||||||
for (final r in account.roots) {
|
for (final r in account.roots) {
|
||||||
final dirPath = file_util.unstripPath(account, r);
|
final dirPath = file_util.unstripPath(account, r);
|
||||||
await SyncDir(_c)(
|
hasChange |= await SyncDir(_c)(
|
||||||
account,
|
account,
|
||||||
dirPath,
|
dirPath,
|
||||||
onProgressUpdate: (value) {
|
onProgressUpdate: (value) {
|
||||||
|
@ -107,10 +108,13 @@ class FilesController {
|
||||||
|
|
||||||
if (!isShareDirIncluded) {
|
if (!isShareDirIncluded) {
|
||||||
_log.info("[syncRemote] Explicitly scanning share folder");
|
_log.info("[syncRemote] Explicitly scanning share folder");
|
||||||
await SyncDir(_c)(account, shareDir.path, isRecursive: false);
|
hasChange |=
|
||||||
|
await SyncDir(_c)(account, shareDir.path, isRecursive: false);
|
||||||
|
}
|
||||||
|
if (hasChange) {
|
||||||
|
// load the synced content to stream
|
||||||
|
unawaited(_reload());
|
||||||
}
|
}
|
||||||
// load the synced content to stream
|
|
||||||
unawaited(_reload());
|
|
||||||
} finally {
|
} finally {
|
||||||
_isSyncing = false;
|
_isSyncing = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue