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