Comick: attempt cache busting (#4363)

This commit is contained in:
AwkwardPeak7 2024-08-01 13:07:38 +05:00 committed by GitHub
parent f8afc640e6
commit 5b71368240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Comick'
extClass = '.ComickFactory'
extVersionCode = 46
extVersionCode = 47
isNsfw = true
}

View File

@ -463,7 +463,16 @@ abstract class Comick(
override fun pageListParse(response: Response): List<Page> {
val result = response.parseAs<PageList>()
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<PageList>().chapter.images
}
return images.mapIndexedNotNull { index, data ->
if (data.url == null) null else Page(index = index, imageUrl = data.url)
}
}