mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
fix #143
This commit is contained in:
@@ -594,7 +594,10 @@ class LocalFavoritesManager with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void onReadEnd(String id, ComicType type) async {
|
||||
void onRead(String id, ComicType type) async {
|
||||
if (appdata.settings['moveFavoriteAfterRead'] == "none") {
|
||||
return;
|
||||
}
|
||||
_modifiedAfterLastCache = true;
|
||||
for (final folder in folderNames) {
|
||||
var rows = _db.select("""
|
||||
|
@@ -50,9 +50,16 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
||||
var (a, b) = LocalFavoritesManager().findLinked(widget.folder);
|
||||
networkSource = a;
|
||||
networkFolder = b;
|
||||
LocalFavoritesManager().addListener(updateComics);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
LocalFavoritesManager().removeListener(updateComics);
|
||||
}
|
||||
|
||||
void selectAll() {
|
||||
setState(() {
|
||||
selectedComics = comics.asMap().map((k, v) => MapEntry(v, true));
|
||||
@@ -382,6 +389,35 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
||||
selections: selectedComics,
|
||||
menuBuilder: (c) {
|
||||
return [
|
||||
MenuEntry(
|
||||
icon: Icons.delete,
|
||||
text: "Delete".tl,
|
||||
onClick: () {
|
||||
LocalFavoritesManager().deleteComicWithId(
|
||||
widget.folder,
|
||||
c.id,
|
||||
(c as FavoriteItem).type,
|
||||
);
|
||||
},
|
||||
),
|
||||
MenuEntry(
|
||||
icon: Icons.check,
|
||||
text: "Select".tl,
|
||||
onClick: () {
|
||||
setState(() {
|
||||
if (!multiSelectMode) {
|
||||
multiSelectMode = true;
|
||||
}
|
||||
if (selectedComics.containsKey(c as FavoriteItem)) {
|
||||
selectedComics.remove(c);
|
||||
_checkExitSelectMode();
|
||||
} else {
|
||||
selectedComics[c] = true;
|
||||
}
|
||||
lastSelectedIndex = comics.indexOf(c);
|
||||
});
|
||||
},
|
||||
),
|
||||
MenuEntry(
|
||||
icon: Icons.download,
|
||||
text: "Download".tl,
|
||||
@@ -657,7 +693,6 @@ class _LocalFavoritesPageState extends State<_LocalFavoritesPage> {
|
||||
(c as FavoriteItem).type,
|
||||
);
|
||||
}
|
||||
updateComics();
|
||||
_cancel();
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@ import 'package:venera/foundation/cache_manager.dart';
|
||||
import 'package:venera/foundation/comic_source/comic_source.dart';
|
||||
import 'package:venera/foundation/comic_type.dart';
|
||||
import 'package:venera/foundation/consts.dart';
|
||||
import 'package:venera/foundation/favorites.dart';
|
||||
import 'package:venera/foundation/history.dart';
|
||||
import 'package:venera/foundation/image_provider/reader_image.dart';
|
||||
import 'package:venera/foundation/local.dart';
|
||||
@@ -165,6 +166,9 @@ class _ReaderState extends State<Reader> with _ReaderLocation, _ReaderWindow {
|
||||
handleVolumeEvent();
|
||||
}
|
||||
setImageCacheSize();
|
||||
Future.delayed(const Duration(milliseconds: 200), () {
|
||||
LocalFavoritesManager().onRead(cid, type);
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user