mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
fix local comic display
This commit is contained in:
@@ -4,6 +4,8 @@ import 'package:venera/foundation/app.dart';
|
||||
import 'package:venera/foundation/comic_source/comic_source.dart';
|
||||
import 'package:venera/foundation/comic_type.dart';
|
||||
import 'package:venera/foundation/history.dart';
|
||||
import 'package:venera/foundation/local.dart';
|
||||
import 'package:venera/utils/ext.dart';
|
||||
import 'package:venera/utils/translations.dart';
|
||||
|
||||
class HistoryPage extends StatefulWidget {
|
||||
@@ -78,9 +80,19 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
SliverGridComics(
|
||||
comics: comics.map(
|
||||
(e) {
|
||||
var cover = e.cover;
|
||||
if (!cover.isURL) {
|
||||
var localComic = LocalManager().find(
|
||||
e.id,
|
||||
e.type,
|
||||
);
|
||||
if(localComic != null) {
|
||||
cover = "file://${localComic.coverFile.path}";
|
||||
}
|
||||
}
|
||||
return Comic(
|
||||
e.title,
|
||||
e.cover,
|
||||
cover,
|
||||
e.id,
|
||||
e.subtitle,
|
||||
null,
|
||||
@@ -100,7 +112,7 @@ class _HistoryPageState extends State<HistoryPage> {
|
||||
icon: Icons.remove,
|
||||
text: 'Remove'.tl,
|
||||
onClick: () {
|
||||
if(c.sourceKey.startsWith("Invalid")) {
|
||||
if (c.sourceKey.startsWith("Invalid")) {
|
||||
HistoryManager().remove(
|
||||
c.id,
|
||||
ComicType(int.parse(c.sourceKey.split(':')[1])),
|
||||
|
Reference in New Issue
Block a user