mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-24 18:38:48 +01:00
ScanDir should not scan our remote storage
This commit is contained in:
parent
15e1591622
commit
7b8ed4885d
2 changed files with 7 additions and 3 deletions
|
@ -2,7 +2,7 @@ import 'package:nc_photos/account.dart';
|
||||||
import 'package:nc_photos/api/api_util.dart' as api_util;
|
import 'package:nc_photos/api/api_util.dart' as api_util;
|
||||||
|
|
||||||
String getRemoteAlbumsDir(Account account) =>
|
String getRemoteAlbumsDir(Account account) =>
|
||||||
"${_getRemoteStorageDir(account)}/albums";
|
"${getRemoteStorageDir(account)}/albums";
|
||||||
|
|
||||||
String _getRemoteStorageDir(Account account) =>
|
String getRemoteStorageDir(Account account) =>
|
||||||
"${api_util.getWebdavRootUrlRelative(account)}/.com.nkming.nc_photos";
|
"${api_util.getWebdavRootUrlRelative(account)}/.com.nkming.nc_photos";
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:logging/logging.dart';
|
||||||
import 'package:nc_photos/account.dart';
|
import 'package:nc_photos/account.dart';
|
||||||
import 'package:nc_photos/entity/file.dart';
|
import 'package:nc_photos/entity/file.dart';
|
||||||
import 'package:nc_photos/exception.dart';
|
import 'package:nc_photos/exception.dart';
|
||||||
|
import 'package:nc_photos/remote_storage_util.dart' as remote_storage_util;
|
||||||
import 'package:nc_photos/use_case/ls.dart';
|
import 'package:nc_photos/use_case/ls.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
|
||||||
|
@ -20,7 +21,10 @@ class ScanDir {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
yield items.where((element) => element.isCollection != true).toList();
|
yield items.where((element) => element.isCollection != true).toList();
|
||||||
for (final i in items.where((element) => element.isCollection == true)) {
|
for (final i in items.where((element) =>
|
||||||
|
element.isCollection == true &&
|
||||||
|
!element.path
|
||||||
|
.endsWith(remote_storage_util.getRemoteStorageDir(account)))) {
|
||||||
yield* this(account, i);
|
yield* this(account, i);
|
||||||
}
|
}
|
||||||
} on CacheNotFoundException catch (e) {
|
} on CacheNotFoundException catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue