Show group in last read and history when group existing. (#419)

This commit is contained in:
角砂糖
2025-06-23 19:03:24 +08:00
committed by GitHub
parent 50044c4372
commit b5b0dc85e3
3 changed files with 22 additions and 9 deletions

View File

@@ -234,6 +234,7 @@
"Please add some sources": "请添加一些源",
"Please check your settings": "请检查您的设置",
"No Category Pages": "没有分类页面",
"Group @group": "第 @group 组",
"Chapter @ep": "第 @ep 章",
"Page @page": "第 @page 页",
"Also remove files on disk": "同时删除磁盘上的文件",
@@ -633,6 +634,7 @@
"Please add some sources": "請添加一些源",
"Please check your settings": "請檢查您的設定",
"No Category Pages": "沒有分類頁面",
"Group @group": "第 @group 組",
"Chapter @ep": "第 @ep 章",
"Page @page": "第 @page 頁",
"Also remove files on disk": "同時刪除磁碟上的文件",

View File

@@ -133,6 +133,11 @@ class History implements Comic {
@override
String get description {
var res = "";
if (group != null){
res += "${"Group @group".tlParams({
"group": group!,
})} - ";
}
if (ep >= 1) {
res += "Chapter @ep".tlParams({
"ep": ep,

View File

@@ -410,20 +410,26 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
String text;
if (haveChapter) {
var epName = "E$ep";
String? groupName;
try {
epName = group == null
? comic.chapters!.titles.elementAt(
if (group == null){
epName = comic.chapters!.titles.elementAt(
math.min(ep - 1, comic.chapters!.length - 1),
)
: comic.chapters!
);
} else {
groupName = comic.chapters!.groups.elementAt(group - 1);
epName = comic.chapters!
.getGroupByIndex(group - 1)
.values
.elementAt(ep - 1);
}
}
catch(e) {
// ignore
}
text = "${"Last Reading".tl}: $epName P$page";
text = groupName == null
? "${"Last Reading".tl}: $epName P$page"
: "${"Last Reading".tl}: $groupName $epName P$page";
} else {
text = "${"Last Reading".tl}: P$page";
}