mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 08:51:48 +01:00
Handle empty thumbnail_url when refreshing covers
This commit is contained in:
parent
e9d3b75e2b
commit
ac8f2923e5
@ -337,8 +337,8 @@ class LibraryUpdateService(
|
|||||||
if (preferences.autoUpdateMetadata()) {
|
if (preferences.autoUpdateMetadata()) {
|
||||||
source.fetchMangaDetails(manga)
|
source.fetchMangaDetails(manga)
|
||||||
.map { updatedManga ->
|
.map { updatedManga ->
|
||||||
// Avoid "losing" covers
|
// Avoid "losing" existing cover
|
||||||
if (updatedManga.thumbnail_url != null) {
|
if (!updatedManga.thumbnail_url.isNullOrEmpty()) {
|
||||||
manga.prepUpdateCover(coverCache, updatedManga, false)
|
manga.prepUpdateCover(coverCache, updatedManga, false)
|
||||||
} else {
|
} else {
|
||||||
updatedManga.thumbnail_url = manga.thumbnail_url
|
updatedManga.thumbnail_url = manga.thumbnail_url
|
||||||
|
@ -17,6 +17,9 @@ fun Manga.prepUpdateCover(coverCache: CoverCache, remoteManga: SManga, refreshSa
|
|||||||
// Never refresh covers if the new url is null, as the current url has possibly become invalid
|
// Never refresh covers if the new url is null, as the current url has possibly become invalid
|
||||||
val newUrl = remoteManga.thumbnail_url ?: return
|
val newUrl = remoteManga.thumbnail_url ?: return
|
||||||
|
|
||||||
|
// Never refresh covers if the url is empty to avoid "losing" existing covers
|
||||||
|
if (newUrl.isEmpty()) return
|
||||||
|
|
||||||
if (!refreshSameUrl && thumbnail_url == newUrl) return
|
if (!refreshSameUrl && thumbnail_url == newUrl) return
|
||||||
|
|
||||||
when {
|
when {
|
||||||
|
Loading…
Reference in New Issue
Block a user