mirror of
https://github.com/mihonapp/mihon.git
synced 2025-02-06 07:15:11 +01:00
Merge 38008d26dc140e60b3b087b47ed19f6cc14c6fd3 into e86aeee9c417dea66d321fd4cbbad7ffdf41b106
This commit is contained in:
commit
0d7e476155
@ -45,7 +45,8 @@ class DownloadProvider(
|
||||
throw Exception(
|
||||
context.stringResource(
|
||||
MR.strings.invalid_location,
|
||||
downloadsDir?.displayablePath ?: "",
|
||||
(downloadsDir?.displayablePath ?: "") +
|
||||
"/${getSourceDirName(source)}/${getMangaDirName(mangaTitle)}",
|
||||
),
|
||||
)
|
||||
}
|
||||
|
@ -315,7 +315,15 @@ class Downloader(
|
||||
* @param download the chapter to be downloaded.
|
||||
*/
|
||||
private suspend fun downloadChapter(download: Download) {
|
||||
val mangaDir = provider.getMangaDir(download.manga.title, download.source)
|
||||
val mangaDir: UniFile
|
||||
try {
|
||||
mangaDir = provider.getMangaDir(download.manga.title, download.source)
|
||||
} catch (error: Exception) {
|
||||
logcat(LogPriority.ERROR, error)
|
||||
download.status = Download.State.ERROR
|
||||
notifier.onError(error.message, download.chapter.name, download.manga.title, download.manga.id)
|
||||
return
|
||||
}
|
||||
|
||||
val availSpace = DiskUtil.getAvailableStorageSpace(mangaDir)
|
||||
if (availSpace != -1L && availSpace < MIN_DISK_SPACE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user