implemented Nextcloud file previews for unknown file types using fileId and has-preview flags, updated file models, and refined manual refresh logic.

This commit is contained in:
2026-05-13 19:44:26 +02:00
parent 843686358f
commit 092f9b622b
6 changed files with 174 additions and 41 deletions
@@ -1,3 +1,5 @@
import 'dart:async';
import 'package:collection/collection.dart';
import '../../../../../api/errors/error_mapper.dart';
@@ -42,6 +44,16 @@ class FilesBloc
await _query(path, renew: true);
}
/// LoadableState.reFetch (used by the pull-to-refresh indicator and the
/// error-screen retry button) routes through here. The inherited retry()
/// goes via gatherData() which respects the cache TTL — for an explicit
/// user-initiated reload we must bypass it, otherwise the root listing
/// silently returns its day-old cached payload without hitting the server.
@override
void retry() {
unawaited(refresh());
}
Future<void> setPath(List<String> path) async {
add(Emit((s) => s.copyWith(currentPath: path, listing: null)));
add(RefetchStarted<FilesState>());