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