From 6fd291c7e3904cea8e08c21dd391bb36c87f8d9d Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 6 Aug 2023 02:10:02 +0200 Subject: [PATCH] Fetch downloaded chapters page again in case the stored file can't be retrieved (#640) In case the file could not be retrieved, the page retrieve just failed and wasn't triggered again. In case of the downloader, the chapter download just kept failing 3 times and was aborted --- .../src/main/kotlin/suwayomi/tachidesk/manga/impl/Page.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Page.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Page.kt index d70275b8..944f99cb 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Page.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Page.kt @@ -88,8 +88,12 @@ object Page { val fileName = getPageName(index) - if (chapterEntry[ChapterTable.isDownloaded]) { - return ChapterDownloadHelper.getImage(mangaId, chapterId, index) + try { + if (chapterEntry[ChapterTable.isDownloaded]) { + return ChapterDownloadHelper.getImage(mangaId, chapterId, index) + } + } catch (_: Exception) { + // ignore and fetch again } val cacheSaveDir = getChapterCachePath(mangaId, chapterId)