From 5b71368240a0baed1b1c3bac8f22f170bca8fd57 Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:07:38 +0500 Subject: [PATCH] Comick: attempt cache busting (#4363) --- src/all/comickfun/build.gradle | 2 +- .../tachiyomi/extension/all/comickfun/Comick.kt | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/all/comickfun/build.gradle b/src/all/comickfun/build.gradle index c2e05a4c3..f85bb5cd0 100644 --- a/src/all/comickfun/build.gradle +++ b/src/all/comickfun/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Comick' extClass = '.ComickFactory' - extVersionCode = 46 + extVersionCode = 47 isNsfw = true } diff --git a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt index 0cd83fc18..3ef873b2e 100644 --- a/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt +++ b/src/all/comickfun/src/eu/kanade/tachiyomi/extension/all/comickfun/Comick.kt @@ -463,7 +463,16 @@ abstract class Comick( override fun pageListParse(response: Response): List { val result = response.parseAs() - return result.chapter.images.mapIndexedNotNull { index, data -> + val images = result.chapter.images.ifEmpty { + // cache busting + val url = response.request.url.newBuilder() + .addQueryParameter("_", System.currentTimeMillis().toString()) + .build() + + client.newCall(GET(url, headers)).execute() + .parseAs().chapter.images + } + return images.mapIndexedNotNull { index, data -> if (data.url == null) null else Page(index = index, imageUrl = data.url) } }