mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Fix random page sent when manga is downloaded (#508)
This commit is contained in:
@@ -33,7 +33,6 @@ class ArchiveProvider(mangaId: Int, chapterId: Int) : DownloadedFilesProvider(ma
|
|||||||
val chapterFolder = File(chapterDir)
|
val chapterFolder = File(chapterDir)
|
||||||
if (outputFile.exists()) handleExistingCbzFile(outputFile, chapterFolder)
|
if (outputFile.exists()) handleExistingCbzFile(outputFile, chapterFolder)
|
||||||
|
|
||||||
|
|
||||||
FolderProvider(mangaId, chapterId).download(download, scope, step)
|
FolderProvider(mangaId, chapterId).download(download, scope, step)
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class FolderProvider(mangaId: Int, chapterId: Int) : DownloadedFilesProvider(man
|
|||||||
val chapterDir = getChapterDownloadPath(mangaId, chapterId)
|
val chapterDir = getChapterDownloadPath(mangaId, chapterId)
|
||||||
val folder = File(chapterDir)
|
val folder = File(chapterDir)
|
||||||
folder.mkdirs()
|
folder.mkdirs()
|
||||||
val file = folder.listFiles()?.get(index)
|
val file = folder.listFiles()?.sortedBy { it.name }?.get(index)
|
||||||
val fileType = file!!.name.substringAfterLast(".")
|
val fileType = file!!.name.substringAfterLast(".")
|
||||||
return Pair(FileInputStream(file).buffered(), "image/$fileType")
|
return Pair(FileInputStream(file).buffered(), "image/$fileType")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user