comic list & explore page

This commit is contained in:
nyne
2024-10-01 16:37:49 +08:00
parent fdb3901fd1
commit 16857185fc
15 changed files with 1232 additions and 102 deletions

View File

@@ -455,11 +455,11 @@ class LocalFavoritesManager {
final _cachedFavoritedIds = <String, bool>{};
bool isExist(String id) {
bool isExist(String id, ComicType type) {
if (_modifiedAfterLastCache) {
_cacheFavoritedIds();
}
return _cachedFavoritedIds.containsKey(id);
return _cachedFavoritedIds.containsKey("$id@${type.value}");
}
bool _modifiedAfterLastCache = true;
@@ -468,11 +468,11 @@ class LocalFavoritesManager {
_modifiedAfterLastCache = false;
_cachedFavoritedIds.clear();
for (var folder in folderNames) {
var res = _db.select("""
select id from "$folder";
var rows = _db.select("""
select id, type from "$folder";
""");
for (var row in res) {
_cachedFavoritedIds[row["id"]] = true;
for (var row in rows) {
_cachedFavoritedIds["${row["id"]}@${row["type"]}"] = true;
}
}
}