Comick: attempt cache busting (#4363)

This commit is contained in:
AwkwardPeak7 2024-08-01 13:07:38 +05:00 committed by Draff
parent 20b9eff851
commit a82548860a
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 11 additions and 2 deletions

View File

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

View File

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