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:
Mitchell Syer
2025-05-16 15:57:53 -04:00
committed by GitHub
parent 336f985894
commit 538bd3f126
6 changed files with 94 additions and 51 deletions

View File

@@ -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)
}