Fixed the fucky that always deleted tags on import/sync

master
Wynd 2026-03-13 23:13:40 +02:00
parent d9773c9fc2
commit 63675ee055
1 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,11 @@ fun parseRecipeFiles(ctx: MainActivity) {
}
// Clearing unused tags after an import/sync
val usedTags = ctx.recipeView.tagFilters.value.map { t -> t.tag }
val usedTags = ctx.db.recipeWithTagsDao().getAll()
.asSequence()
.flatMap { it.tags }
.map { it.name }
.toList()
for (tag in ctx.db.tagDao().getAll()) {
if (!usedTags.contains(tag.name)) {
ctx.db.tagDao().delete(tag.name)