Added 'go back' functionality and fileinfos to Fileviewer
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFiles.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesParams.dart';
|
||||
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesResponse.dart';
|
||||
@ -11,21 +9,17 @@ class ListFilesCache extends RequestCache<ListFilesResponse> {
|
||||
|
||||
ListFilesCache({required onUpdate, required this.path}) : super(RequestCache.cacheNothing, onUpdate) {
|
||||
String cacheName = path.replaceAll(RegExp("[^A-Za-z0-9]"), "_"); //TODO this is very evil, "/ü/" > "___" also "/ä/" > "___"
|
||||
log(cacheName);
|
||||
|
||||
start("MarianumMobile", "wd-folder-$cacheName");
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ListFilesResponse> onLoad() async {
|
||||
log("Loading remote data");
|
||||
ListFilesResponse data = await ListFiles(ListFilesParams(path)).run();
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
ListFilesResponse onLocalData(String json) {
|
||||
log("Loading local data");
|
||||
return ListFilesResponse.fromJson(jsonDecode(json));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user