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:
arkon
2023-12-14 23:26:02 -05:00
parent d20a8fcf13
commit 58daedc89e
6 changed files with 150 additions and 203 deletions

View File

@@ -74,7 +74,7 @@ class DeepLinkScreenModel(
}
private suspend fun getMangaFromSManga(sManga: SManga, sourceId: Long): Manga {
return getMangaByUrlAndSourceId.awaitManga(sManga.url, sourceId)
return getMangaByUrlAndSourceId.await(sManga.url, sourceId)
?: networkToLocalManga.await(sManga.toDomainManga(sourceId))
}