From aa66111f2cd9a9a23ab1358739520692073d63fa Mon Sep 17 00:00:00 2001 From: nyne Date: Sat, 21 Dec 2024 17:38:59 +0800 Subject: [PATCH] fix updating comic info --- lib/pages/favorites/favorite_actions.dart | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/pages/favorites/favorite_actions.dart b/lib/pages/favorites/favorite_actions.dart index 6c3a822..b9512d7 100644 --- a/lib/pages/favorites/favorite_actions.dart +++ b/lib/pages/favorites/favorite_actions.dart @@ -146,6 +146,18 @@ Future> updateComicsInfo(String folder) async { var newInfo = (await comicSource.loadComicInfo!(c.id)).data; + var newTags = []; + for(var entry in newInfo.tags.entries) { + const shouldIgnore = ['author', 'artist', 'time']; + var namespace = entry.key; + if (shouldIgnore.contains(namespace.toLowerCase())) { + continue; + } + for(var tag in entry.value) { + newTags.add("$namespace:$tag"); + } + } + comics[index] = FavoriteItem( id: c.id, name: newInfo.title, @@ -154,7 +166,7 @@ Future> updateComicsInfo(String folder) async { newInfo.tags['author']?.firstOrNull ?? c.author, type: c.type, - tags: c.tags, + tags: newTags, ); LocalFavoritesManager().updateInfo(folder, comics[index]);