mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 21:47:28 +01:00
Clean up manga restoring logic
Some behavior changes: - It prioritizes new entries, then anything more recently updated - It copies the more recently updated entry's metadata (description, thumbnail, etc.)
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
package eu.kanade.tachiyomi.source.model
|
||||
|
||||
import tachiyomi.data.Mangas
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
|
||||
fun Manga.copyFrom(other: Mangas): Manga {
|
||||
var manga = this
|
||||
other.author?.let { manga = manga.copy(author = it) }
|
||||
other.artist?.let { manga = manga.copy(artist = it) }
|
||||
other.description?.let { manga = manga.copy(description = it) }
|
||||
other.genre?.let { manga = manga.copy(genre = it) }
|
||||
other.thumbnail_url?.let { manga = manga.copy(thumbnailUrl = it) }
|
||||
manga = manga.copy(status = other.status)
|
||||
if (!initialized) {
|
||||
manga = manga.copy(initialized = other.initialized)
|
||||
}
|
||||
return manga
|
||||
}
|
||||
Reference in New Issue
Block a user