From 63675ee055f60d7c5f803b18eaa894453c0ca39b Mon Sep 17 00:00:00 2001 From: Wynd Date: Fri, 13 Mar 2026 23:13:40 +0200 Subject: [PATCH] Fixed the fucky that always deleted tags on import/sync --- .../main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt b/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt index 9aa5c4d..f79ca45 100644 --- a/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt +++ b/app/src/main/java/xyz/pixelatedw/recipe/utils/RecipeParser.kt @@ -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)