mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
fix updating comic info
This commit is contained in:
@@ -146,6 +146,18 @@ Future<List<FavoriteItem>> updateComicsInfo(String folder) async {
|
|||||||
|
|
||||||
var newInfo = (await comicSource.loadComicInfo!(c.id)).data;
|
var newInfo = (await comicSource.loadComicInfo!(c.id)).data;
|
||||||
|
|
||||||
|
var newTags = <String>[];
|
||||||
|
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(
|
comics[index] = FavoriteItem(
|
||||||
id: c.id,
|
id: c.id,
|
||||||
name: newInfo.title,
|
name: newInfo.title,
|
||||||
@@ -154,7 +166,7 @@ Future<List<FavoriteItem>> updateComicsInfo(String folder) async {
|
|||||||
newInfo.tags['author']?.firstOrNull ??
|
newInfo.tags['author']?.firstOrNull ??
|
||||||
c.author,
|
c.author,
|
||||||
type: c.type,
|
type: c.type,
|
||||||
tags: c.tags,
|
tags: newTags,
|
||||||
);
|
);
|
||||||
|
|
||||||
LocalFavoritesManager().updateInfo(folder, comics[index]);
|
LocalFavoritesManager().updateInfo(folder, comics[index]);
|
||||||
|
Reference in New Issue
Block a user