Fix tags for suggestions

This commit is contained in:
Koitharu
2022-02-28 19:08:16 +02:00
parent 3afa782e91
commit 5d26743c8f

View File

@@ -32,7 +32,9 @@ class SuggestionRepository(
db.withTransaction {
db.suggestionDao.deleteAll()
suggestions.forEach { x ->
db.mangaDao.upsert(MangaEntity.from(x.manga))
val tags = x.manga.tags.map(TagEntity.Companion::fromMangaTag)
db.tagsDao.upsert(tags)
db.mangaDao.upsert(MangaEntity.from(x.manga), tags)
db.suggestionDao.upsert(
SuggestionEntity(
mangaId = x.manga.id,