mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:09:18 +01:00
Fix manga covers from browse or extension intents sometimes not showing
This commit is contained in:
parent
ee42eb347f
commit
59c98f03d5
@ -85,22 +85,24 @@ class MangaFetcher : Fetcher<Manga> {
|
||||
shouldFetchRemotely
|
||||
)
|
||||
|
||||
val tmpFile = File(coverFile.absolutePath + "_tmp")
|
||||
body.source().use { input ->
|
||||
tmpFile.sink().buffer().use { output ->
|
||||
output.writeAll(input)
|
||||
}
|
||||
}
|
||||
|
||||
if (response.isSuccessful || !coverFile.exists()) {
|
||||
if (coverFile.exists()) {
|
||||
coverFile.delete()
|
||||
if (options.diskCachePolicy.writeEnabled) {
|
||||
val tmpFile = File(coverFile.absolutePath + "_tmp")
|
||||
body.source().use { input ->
|
||||
tmpFile.sink().buffer().use { output ->
|
||||
output.writeAll(input)
|
||||
}
|
||||
}
|
||||
|
||||
tmpFile.renameTo(coverFile)
|
||||
}
|
||||
if (manga.favorite) {
|
||||
coverCache.deleteCachedCovers()
|
||||
if (response.isSuccessful || !coverFile.exists()) {
|
||||
if (coverFile.exists()) {
|
||||
coverFile.delete()
|
||||
}
|
||||
|
||||
tmpFile.renameTo(coverFile)
|
||||
}
|
||||
if (manga.favorite) {
|
||||
coverCache.deleteCachedCovers()
|
||||
}
|
||||
}
|
||||
return fileLoader(coverFile)
|
||||
}
|
||||
|
@ -12,11 +12,9 @@ import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import coil.loadAny
|
||||
import coil.request.CachePolicy
|
||||
import coil.request.Parameters
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.image.coil.MangaFetcher
|
||||
import eu.kanade.tachiyomi.databinding.MangaHeaderItemBinding
|
||||
import eu.kanade.tachiyomi.source.LocalSource
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
@ -329,7 +327,8 @@ class MangaHeaderHolder(
|
||||
builder = {
|
||||
placeholder(drawable)
|
||||
error(drawable)
|
||||
if (manga.favorite) networkCachePolicy(CachePolicy.DISABLED)
|
||||
if (manga.favorite) networkCachePolicy(CachePolicy.READ_ONLY)
|
||||
diskCachePolicy(CachePolicy.READ_ONLY)
|
||||
}
|
||||
)
|
||||
binding.backdrop.loadAny(
|
||||
@ -337,7 +336,8 @@ class MangaHeaderHolder(
|
||||
builder = {
|
||||
placeholder(drawable)
|
||||
error(drawable)
|
||||
if (manga.favorite) networkCachePolicy(CachePolicy.DISABLED)
|
||||
if (manga.favorite) networkCachePolicy(CachePolicy.READ_ONLY)
|
||||
diskCachePolicy(CachePolicy.READ_ONLY)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user