Skip to content

Commit

Permalink
✨ reset downloads button
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Nov 22, 2023
1 parent f8e45c1 commit 6c37764
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ok": "确认",
"copyLoginUrl": "复制登录链接",
"pcLoginNotice": "1. 请您打开VPN或代理, 然后点击下面的打开登录链接\n2. 打开浏览器后按F12呼出浏览器的调试菜单, 找到network或网络\n3. 您登录成功后将显示红色pixiv开头的url\n4. 请将CODE部分填入下面的位置点击确定 (code=*CODE*&via=login)",
"downloadAllPicturesToFiles": "下载所有原图到文件",
"downloadAllOriginalImagesToFiles": "下载所有原图到文件",
"settings": "设置",
"logout": "登出",
"downloads": "下载",
Expand Down
25 changes: 18 additions & 7 deletions lib/screens/downloads_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class _DownloadsScreenState extends State<DownloadsScreen> {
title: Text(
AppLocalizations.of(context)!.downloads,
),
actions: [
IconButton(
icon: const Icon(Icons.refresh),
onPressed: () async {
await api.resetFailedDownloads();
_fetch();
},
),
],
),
body: ListView(children: [
..._buildItems(),
Expand Down Expand Up @@ -67,13 +76,15 @@ class _DownloadsScreenState extends State<DownloadsScreen> {
Expanded(child: Container()),
Text(item.downloadStatus == 2 ? "下载失败" : "下载中"),
Expanded(child: Container()),
...(item.downloadStatus == 2 ? [
Text(
item.errorMsg,
maxLines: 1,
),
Expanded(child: Container()),
] : []),
...(item.downloadStatus == 2
? [
Text(
item.errorMsg,
maxLines: 1,
),
Expanded(child: Container()),
]
: []),
],
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 6c37764

Please sign in to comment.