mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-15 16:54:09 -05:00
Improve Downloads Handling (#1387)
* Improve Downloads Handling * Update known pagecount for downloaded chapters * Get fresh data for downloadReady * Format * Assume downloaded if first page is found * Filter out ComicInfoFile
This commit is contained in:
@@ -110,7 +110,7 @@ object Page {
|
||||
}
|
||||
}
|
||||
|
||||
val fileName = getPageName(index)
|
||||
val fileName = getPageName(index, chapterEntry[ChapterTable.pageCount])
|
||||
|
||||
val cacheSaveDir = getChapterCachePath(mangaId, chapterId)
|
||||
|
||||
@@ -121,5 +121,8 @@ object Page {
|
||||
}
|
||||
|
||||
/** converts 0 to "001" */
|
||||
fun getPageName(index: Int): String = String.format("%03d", index + 1)
|
||||
fun getPageName(
|
||||
index: Int,
|
||||
pageCount: Int,
|
||||
): String = String.format("%0${pageCount.toString().length.coerceAtLeast(3)}d", index + 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user