mirror of
https://github.com/mihonapp/mihon.git
synced 2025-02-06 15:25:00 +01:00
If the browse manga is initialized update everything otherwise only update the title and thumbnail
This commit is contained in:
parent
cb5025dd18
commit
1c202920be
@ -17,10 +17,18 @@ class NetworkToLocalManga(
|
||||
}
|
||||
!localManga.favorite -> {
|
||||
// if the manga isn't a favorite, update new info from source to db
|
||||
val mangaUpdate = manga.toMangaUpdate().copy(
|
||||
id = localManga.id,
|
||||
thumbnailUrl = manga.thumbnailUrl?.takeUnless { it.isBlank() },
|
||||
)
|
||||
val newThumbnail = manga.thumbnailUrl?.takeUnless { it.isBlank() }
|
||||
val mangaUpdate = if (manga.initialized) {
|
||||
manga.toMangaUpdate().copy(
|
||||
id = localManga.id,
|
||||
thumbnailUrl = newThumbnail,
|
||||
)
|
||||
} else {
|
||||
localManga.toMangaUpdate().copy(
|
||||
title = manga.title,
|
||||
thumbnailUrl = newThumbnail,
|
||||
)
|
||||
}
|
||||
mangaRepository.update(mangaUpdate)
|
||||
manga.copy(id = localManga.id)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user