Using md5 file-naming for caching

This commit is contained in:
Elias Müller 2023-05-07 00:24:19 +02:00
parent 09f3a24c87
commit eaccd5cc54
6 changed files with 41 additions and 30 deletions

View File

@ -187,7 +187,7 @@
<entry key="cli_util"> <entry key="cli_util">
<value> <value>
<list> <list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/cli_util-0.3.5/lib" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/cli_util-0.4.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -348,7 +348,7 @@
<entry key="flutter_launcher_icons"> <entry key="flutter_launcher_icons">
<value> <value>
<list> <list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_launcher_icons-0.12.0/lib" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_launcher_icons-0.13.1/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -614,7 +614,7 @@
<entry key="nextcloud"> <entry key="nextcloud">
<value> <value>
<list> <list>
<option value="$USER_HOME$/.pub-cache/git/nextcloud-neon-32c6fb857586fda20ced274ed131be90c9adc67d/packages/nextcloud/lib" /> <option value="$USER_HOME$/.pub-cache/git/nextcloud-neon-a7be31ff2632d02eea7c19afbfb8e6edf2ea473d/packages/nextcloud/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -859,7 +859,7 @@
<entry key="source_gen"> <entry key="source_gen">
<value> <value>
<list> <list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-1.2.7/lib" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-1.3.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -1062,7 +1062,7 @@
<entry key="win32"> <entry key="win32">
<value> <value>
<list> <list>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/win32-4.1.3/lib" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/win32-4.1.4/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -1098,7 +1098,7 @@
</properties> </properties>
<CLASSES> <CLASSES>
<root url="file://$USER_HOME$/.pub-cache/git/flowder-1ddd171a763c4f1ba09b95e34e35e2e5cf0d1bba//lib" /> <root url="file://$USER_HOME$/.pub-cache/git/flowder-1ddd171a763c4f1ba09b95e34e35e2e5cf0d1bba//lib" />
<root url="file://$USER_HOME$/.pub-cache/git/nextcloud-neon-32c6fb857586fda20ced274ed131be90c9adc67d/packages/nextcloud/lib" /> <root url="file://$USER_HOME$/.pub-cache/git/nextcloud-neon-a7be31ff2632d02eea7c19afbfb8e6edf2ea473d/packages/nextcloud/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-59.0.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-59.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/analyzer-5.11.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/another_flushbar-1.12.29/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/another_flushbar-1.12.29/lib" />
@ -1125,7 +1125,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cached_network_image_web-1.0.2/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cached_network_image_web-1.0.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/characters-1.2.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/characters-1.2.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/checked_yaml-2.0.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cli_util-0.3.5/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cli_util-0.4.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/clock-1.1.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/clock-1.1.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/code_builder-4.4.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/code_builder-4.4.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/collection-1.17.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/collection-1.17.0/lib" />
@ -1146,7 +1146,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/fixnum-1.1.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/fixnum-1.1.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_blurhash-0.7.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_cache_manager-3.3.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_cache_manager-3.3.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_launcher_icons-0.12.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_launcher_icons-0.13.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_linkify-5.0.2/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_linkify-5.0.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_lints-2.0.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_lints-2.0.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_login-4.1.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_login-4.1.1/lib" />
@ -1215,7 +1215,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf-1.4.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf-1.4.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.4/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/sign_in_button-3.2.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/sign_in_button-3.2.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-1.2.7/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-1.3.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_helper-1.3.3/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_helper-1.3.3/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_span-1.9.1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_span-1.9.1/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/sqflite-2.2.8+1/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/sqflite-2.2.8+1/lib" />
@ -1244,7 +1244,7 @@
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/version-3.0.2/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/version-3.0.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/watcher-1.0.2/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/watcher-1.0.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/win32-4.1.3/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/win32-4.1.4/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xdg_directories-1.0.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xdg_directories-1.0.0/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xml-6.2.2/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xml-6.2.2/lib" />
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xml_annotation-2.2.0/lib" /> <root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/xml_annotation-2.2.0/lib" />

View File

@ -9,7 +9,10 @@
<option name="modules"> <option name="modules">
<set> <set>
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/better_open_file-3.6.4/android" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/better_open_file-3.6.4/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/file_picker-5.2.11/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_native_splash-2.2.19/android" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_native_splash-2.2.19/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.14/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/image_picker_android-0.8.6+11/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/android" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/shared_preferences_android-2.1.4/android" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/shared_preferences_android-2.1.4/android" />
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/sqflite-2.2.8+1/android" /> <option value="$USER_HOME$/.pub-cache/hosted/pub.dev/sqflite-2.2.8+1/android" />

View File

@ -17,8 +17,8 @@
<option name="url" value="https://repo.maven.apache.org/maven2/" /> <option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="Google7" /> <option name="id" value="Google9" />
<option name="name" value="Google7" /> <option name="name" value="Google9" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" /> <option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository> </remote-repository>
<remote-repository> <remote-repository>

View File

@ -4,33 +4,32 @@
<option name="autoReloadType" value="NONE" /> <option name="autoReloadType" value="NONE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b12972d0-6414-4d45-a46d-735d4cabb20a" name="Changes" comment=""> <list default="true" id="55523c1b-a651-4ecd-b499-9518606f9735" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/../.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../.idea/libraries/Dart_Packages.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../.idea/libraries/Dart_Packages.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../.idea/libraries/Dart_Packages.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../.idea/libraries/Flutter_Plugins.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../.idea/libraries/Flutter_Plugins.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/jarRepositories.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/kotlinc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../pubspec.yaml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" /> <option name="LAST_RESOLUTION" value="IGNORE" />
</component> </component>
<component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[/home/elias/.android/avd/Pixel_XL_API_30.avd]" />
<component name="ExternalProjectsData"> <component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$"> <projectState path="$PROJECT_DIR$">
<ProjectState /> <ProjectState />
</projectState> </projectState>
</component> </component>
<component name="GenerateSignedApkSettings">
<option name="EXPORT_PRIVATE_KEY" value="false" />
<option name="KEY_STORE_PATH" value="$USER_HOME$/upload-keystore.jks" />
<option name="KEY_ALIAS" value="upload" />
</component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component> </component>
<component name="ProjectId" id="2PLL52HWsN0gIlWSFqe92pMyCcT" /> <component name="ProjectId" id="2PQt9ih7RXI4ANibeGG9zQL3kSX" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" /> <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState"> <component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
@ -38,12 +37,18 @@
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent"><![CDATA[{
"keyToString": { "keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true", "BundleExportedModule": "android.app",
"RunOnceActivity.ShowReadmeOnStart": "true", "ExportBundle.BundlePathForandroid.app": "/home/elias/projects/MarianumMobile/Client/android/app",
"RunOnceActivity.cidr.known.project.marker": "true", "RunOnceActivity.cidr.known.project.marker": "true",
"cidr.known.project.marker": "true", "cidr.known.project.marker": "true",
"dart.analysis.tool.window.visible": "false", "dart.analysis.tool.window.visible": "false",
"last_opened_file_path": "/home/elias/upload-keystore.jks",
"show.migrate.to.gradle.popup": "false" "show.migrate.to.gradle.popup": "false"
},
"keyToStringList": {
"ExportApk.BuildVariants": [
"release"
]
} }
}]]></component> }]]></component>
<component name="RunManager"> <component name="RunManager">
@ -109,11 +114,11 @@
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager"> <component name="TaskManager">
<task active="true" id="Default" summary="Default task"> <task active="true" id="Default" summary="Default task">
<changelist id="b12972d0-6414-4d45-a46d-735d4cabb20a" name="Changes" comment="" /> <changelist id="55523c1b-a651-4ecd-b499-9518606f9735" name="Changes" comment="" />
<created>1683231228875</created> <created>1683400983746</created>
<option name="number" value="Default" /> <option name="number" value="Default" />
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1683231228875</updated> <updated>1683400983746</updated>
</task> </task>
<servers /> <servers />
</component> </component>

View File

@ -1,4 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:crypto/crypto.dart';
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFiles.dart'; 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/listFilesParams.dart';
import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesResponse.dart'; import 'package:marianum_mobile/api/marianumcloud/webdav/queries/listFiles/listFilesResponse.dart';
@ -8,7 +9,8 @@ class ListFilesCache extends RequestCache<ListFilesResponse> {
String path; String path;
ListFilesCache({required onUpdate, required this.path}) : super(RequestCache.cacheNothing, onUpdate) { 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 "/ä/" > "___" var bytes = utf8.encode("MarianumMobile-$path");
String cacheName = md5.convert(bytes).toString();
start("MarianumMobile", "wd-folder-$cacheName"); start("MarianumMobile", "wd-folder-$cacheName");
} }

View File

@ -67,6 +67,7 @@ dependencies:
image_picker: ^0.8.7+4 image_picker: ^0.8.7+4
file_picker: ^5.2.11 file_picker: ^5.2.11
loader_overlay: ^2.2.0 loader_overlay: ^2.2.0
crypto: ^3.0.3
dependency_overrides: dependency_overrides:
xml: ^6.2.2 xml: ^6.2.2