Fix first page not being detected correctly (#253)

* fix first page not being recognized correctly

* fix first page not being recognized correctly
This commit is contained in:
Aria Moradi
2021-11-15 23:49:02 +03:30
committed by GitHub
parent bd960992bc
commit e7041e8c8c

View File

@@ -162,9 +162,12 @@ object Chapter {
}.first()
}
val isReallyDownloaded =
chapterEntry[ChapterTable.isDownloaded] && firstPageExists(mangaId, chapterEntry[ChapterTable.id].value)
return if (!isReallyDownloaded) {
val isPartiallyDownloaded =
!(chapterEntry[ChapterTable.isDownloaded] && firstPageExists(mangaId, chapterEntry[ChapterTable.id].value))
return if (isPartiallyDownloaded) {
// chapter files may have been deleted
transaction {
ChapterTable.update({ (ChapterTable.sourceOrder eq chapterIndex) and (ChapterTable.manga eq mangaId) }) {
it[isDownloaded] = false
@@ -243,7 +246,7 @@ object Chapter {
return ImageResponse.findFileNameStartingWith(
chapterDir,
getPageName(0)
getPageName(1)
) != null
}