mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 23:22:07 +00:00
Why create and then delete BtDirectory?
Same as previous commit
This commit is contained in:
parent
eb4f82f040
commit
18d6079420
1 changed files with 8 additions and 4 deletions
|
|
@ -34,8 +34,8 @@ class StorageProvider {
|
|||
}
|
||||
|
||||
Future<void> deleteBtDirectory() async {
|
||||
final d = await getBtDirectory();
|
||||
await Directory(d!.path).delete(recursive: true);
|
||||
final btDir = Directory(await _btDirectoryPath());
|
||||
if (await btDir.exists()) await btDir.delete(recursive: true);
|
||||
}
|
||||
|
||||
Future<void> deleteTmpDirectory() async {
|
||||
|
|
@ -56,12 +56,16 @@ class StorageProvider {
|
|||
}
|
||||
|
||||
Future<Directory?> getBtDirectory() async {
|
||||
final defaultDirectory = await getDefaultDirectory();
|
||||
String dbDir = path.join(defaultDirectory!.path, 'torrents');
|
||||
String dbDir = await _btDirectoryPath();
|
||||
await Directory(dbDir).create(recursive: true);
|
||||
return Directory(dbDir);
|
||||
}
|
||||
|
||||
Future<String> _btDirectoryPath() async {
|
||||
final defaultDirectory = await getDefaultDirectory();
|
||||
return path.join(defaultDirectory!.path, 'torrents');
|
||||
}
|
||||
|
||||
Future<Directory?> getTmpDirectory() async {
|
||||
String tmpPath = await _tempDirectoryPath();
|
||||
await Directory(tmpPath).create(recursive: true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue