mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
fix: download job stops all together even if 1 entry is failed to create directory
This commit is contained in:
parent
8c18edc4c7
commit
38008d26dc
1 changed files with 9 additions and 1 deletions
|
@ -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…
Reference in a new issue