Update domain/src/main/java/tachiyomi/domain/manga/interactor/NetworkToLocalManga.kt

This commit is contained in:
AntsyLich 2024-11-21 19:39:45 +06:00 committed by GitHub
parent b8997ecbc8
commit cb5025dd18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,13 +17,11 @@ class NetworkToLocalManga(
}
!localManga.favorite -> {
// if the manga isn't a favorite, update new info from source to db
mangaRepository.update(
manga.toMangaUpdate()
.copy(
id = localManga.id,
thumbnailUrl = manga.thumbnailUrl?.takeIf { it.isNotBlank() },
),
val mangaUpdate = manga.toMangaUpdate().copy(
id = localManga.id,
thumbnailUrl = manga.thumbnailUrl?.takeUnless { it.isBlank() },
)
mangaRepository.update(mangaUpdate)
manga.copy(id = localManga.id)
}
else -> {