diff --git a/lib/services/remote_assets_service.dart b/lib/services/remote_assets_service.dart index 8a11f84a4..bb9726a67 100644 --- a/lib/services/remote_assets_service.dart +++ b/lib/services/remote_assets_service.dart @@ -27,7 +27,7 @@ class RemoteAssetsService { } Future _getLocalPath(String remotePath) async { - return (await getTemporaryDirectory()).path + + return (await getApplicationSupportDirectory()).path + "/assets/" + _urlToFileName(remotePath); } diff --git a/lib/services/semantic_search/frameworks/ml_framework.dart b/lib/services/semantic_search/frameworks/ml_framework.dart index 3523c721e..ad2b26654 100644 --- a/lib/services/semantic_search/frameworks/ml_framework.dart +++ b/lib/services/semantic_search/frameworks/ml_framework.dart @@ -2,7 +2,6 @@ import "dart:async"; import "dart:io"; import "package:connectivity_plus/connectivity_plus.dart"; -import "package:flutter/services.dart"; import "package:logging/logging.dart"; import "package:path/path.dart"; import "package:path_provider/path_provider.dart"; @@ -134,13 +133,13 @@ abstract class MLFramework { } Future _getLocalImageModelPath() async { - return (await getTemporaryDirectory()).path + + return (await getApplicationSupportDirectory()).path + "/models/" + basename(getImageModelRemotePath()); } Future _getLocalTextModelPath() async { - return (await getTemporaryDirectory()).path + + return (await getApplicationSupportDirectory()).path + "/models/" + basename(getTextModelRemotePath()); } @@ -176,17 +175,6 @@ abstract class MLFramework { return connectivityResult != ConnectivityResult.mobile || shouldDownloadOverMobileData; } - - Future getAccessiblePathForAsset( - String assetPath, - String tempName, - ) async { - final byteData = await rootBundle.load(assetPath); - final tempDir = await getTemporaryDirectory(); - final file = await File('${tempDir.path}/$tempName') - .writeAsBytes(byteData.buffer.asUint8List()); - return file.path; - } } class MLFrameworkInitializationUpdateEvent extends Event {