Fix CBZ download bug for newly added mangas in Library (#499)

This commit is contained in:
akabhirav
2023-02-13 21:17:14 +05:30
committed by GitHub
parent d4e71274f9
commit 13f5486d0b

View File

@@ -33,12 +33,13 @@ class ArchiveProvider(mangaId: Int, chapterId: Int) : DownloadedFilesProvider(ma
val chapterFolder = File(chapterDir)
if (outputFile.exists()) handleExistingCbzFile(outputFile, chapterFolder)
FolderProvider(mangaId, chapterId).download(download, scope, step)
withContext(Dispatchers.IO) {
outputFile.createNewFile()
}
FolderProvider(mangaId, chapterId).download(download, scope, step)
ZipOutputStream(outputFile.outputStream()).use { zipOut ->
if (chapterFolder.isDirectory) {
chapterFolder.listFiles()?.sortedBy { it.name }?.forEach {