mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-29 12:37:50 +02:00
Fixup HttpPageLoader _loadPage (#8984)
Fixup for e4bc8990
(#8955)
HttpSource.fetchImage() uses Call.asObservableSuccess(), which
cancels the call on unsubscribe. This causes the call to be cancelled
before it is used, leading to a "java.net.SocketException: Socket is
closed" when trying to use the response in putImageToCache().
To fix this, use Call.awaitSuccess() via a new HttpSource.getImage()
suspending function. This addition to source-api is only intended for
app use, so it will not be added to the extensions-api stubs.
This commit is contained in:
@ -200,7 +200,7 @@ class HttpPageLoader(
|
||||
|
||||
if (!chapterCache.isImageInCache(imageUrl)) {
|
||||
page.status = Page.State.DOWNLOAD_IMAGE
|
||||
val imageResponse = source.fetchImage(page).awaitSingle()
|
||||
val imageResponse = source.getImage(page)
|
||||
chapterCache.putImageToCache(imageUrl, imageResponse)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user