mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Fix unsupported files returned from scan account bloc
This commit is contained in:
parent
9759f172db
commit
72ebbfdd08
1 changed files with 4 additions and 5 deletions
|
@ -204,8 +204,7 @@ class ScanAccountDirBloc
|
||||||
"[_onEventQuery] Elapsed time (_queryOffline): ${stopwatch.elapsedMilliseconds}ms, ${cacheFiles.length} files");
|
"[_onEventQuery] Elapsed time (_queryOffline): ${stopwatch.elapsedMilliseconds}ms, ${cacheFiles.length} files");
|
||||||
if (!hasContent) {
|
if (!hasContent) {
|
||||||
// show something instantly on first load
|
// show something instantly on first load
|
||||||
emit(ScanAccountDirBlocLoading(
|
emit(ScanAccountDirBlocLoading(cacheFiles));
|
||||||
cacheFiles.where((f) => file_util.isSupportedFormat(f)).toList()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stopwatch.reset();
|
stopwatch.reset();
|
||||||
|
@ -214,8 +213,7 @@ class ScanAccountDirBloc
|
||||||
hasUpdate = await _syncOnline(ev);
|
hasUpdate = await _syncOnline(ev);
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
_log.shout("[_onEventQuery] Exception while request", e, stackTrace);
|
_log.shout("[_onEventQuery] Exception while request", e, stackTrace);
|
||||||
emit(ScanAccountDirBlocFailure(
|
emit(ScanAccountDirBlocFailure(cacheFiles, e));
|
||||||
cacheFiles.where((f) => file_util.isSupportedFormat(f)).toList(), e));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_log.info(
|
_log.info(
|
||||||
|
@ -434,7 +432,8 @@ class ScanAccountDirBloc
|
||||||
if (!isShareDirIncluded) {
|
if (!isShareDirIncluded) {
|
||||||
_log.info("[_queryOffline] Explicitly scanning share folder");
|
_log.info("[_queryOffline] Explicitly scanning share folder");
|
||||||
try {
|
try {
|
||||||
files.addAll(await Ls(_c.fileRepoLocal)(account, shareDir));
|
final raw = await Ls(_c.fileRepoLocal)(account, shareDir);
|
||||||
|
files.addAll(raw.where((f) => file_util.isSupportedFormat(f)));
|
||||||
} on CacheNotFoundException catch (_) {
|
} on CacheNotFoundException catch (_) {
|
||||||
// normal when there's no cache
|
// normal when there's no cache
|
||||||
} catch (e, stackTrace) {
|
} catch (e, stackTrace) {
|
||||||
|
|
Loading…
Reference in a new issue