mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-16 05:13:41 +00:00
fix: web download dir setting (#46)
This commit is contained in:
1 parent
35156ed968
commit
57befd2c03
1 file changed
+4
-5
@@ -13,7 +13,7 @@ class Setting {
|
|||||||
String host = "127.0.0.1";
|
String host = "127.0.0.1";
|
||||||
int port = 0;
|
int port = 0;
|
||||||
int connections = 0;
|
int connections = 0;
|
||||||
String downloadDir = "";
|
late String downloadDir;
|
||||||
late ThemeMode themeMode;
|
late ThemeMode themeMode;
|
||||||
late String locale;
|
late String locale;
|
||||||
|
|
||||||
@@ -44,10 +44,6 @@ class Setting {
|
|||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Util.isWeb()) {
|
|
||||||
downloadDir = "./";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Util.isAndroid()) {
|
if (Util.isAndroid()) {
|
||||||
downloadDir =
|
downloadDir =
|
||||||
'${await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS)}/com.gopeed';
|
'${await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS)}/com.gopeed';
|
||||||
@@ -55,6 +51,9 @@ class Setting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (downloadDir.isEmpty) {
|
if (downloadDir.isEmpty) {
|
||||||
|
if (Util.isWeb()) {
|
||||||
|
downloadDir = './';
|
||||||
|
}
|
||||||
if (Util.isDesktop()) {
|
if (Util.isDesktop()) {
|
||||||
downloadDir = (await getDownloadsDirectory())!.path;
|
downloadDir = (await getDownloadsDirectory())!.path;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user