From 336a3926a4efc27445c8083ad9df88aa673a6b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=85=B1=E5=A4=A9=E5=B0=8F=E7=A6=BD=E5=85=BD?= Date: Tue, 12 Mar 2024 00:35:14 +0800 Subject: [PATCH] Fix the bug that cannot vote or add comments in some scenarios MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复部分场景下无法投票评论、新增评论的bug --- changelog/v7.4.13+176.md | 43 +++++++++++++++++++ changelog/v7.4.13.md | 42 +----------------- .../pages/details/comment/comment_page.dart | 4 +- lib/src/pages/details/comment/eh_comment.dart | 4 +- lib/src/pages/details/details_page.dart | 1 - .../details/thumbnails/thumbnails_page.dart | 12 +++++- lib/src/widget/eh_comment_dialog.dart | 4 +- pubspec.yaml | 2 +- 8 files changed, 62 insertions(+), 50 deletions(-) create mode 100644 changelog/v7.4.13+176.md diff --git a/changelog/v7.4.13+176.md b/changelog/v7.4.13+176.md new file mode 100644 index 000000000..fc5cc8a12 --- /dev/null +++ b/changelog/v7.4.13+176.md @@ -0,0 +1,43 @@ +- 支持隐藏快速回顶按钮 +- 支持标记出已过期的画廊种子 +- 现在画廊图片加载失败时,会自动尝试重新解析其他节点 +- 优化标签评分的状态更新逻辑 +- 优化详情页标题 +- 优化部分网络错误的提示文案 +- 优化日志页的显示 +- 优化标签搜索 +- 优化历史记录读取性能 +- 优化下载页列表布局的性能,支持取消列表动画 +- 下载时优先使用列表页的标题 +- 修复评分画廊后UI状态未更新的bug +- 修复详情页刷新时的UI bug +- 修复部分场景下删除本地画廊时的bug +- 修复无法删除超分图片的bug +- 修复部分情况下无法超分图片的bug +- 修复在关闭标签搜索继承时点击tag搜索时的路由bug +- 修复下载页列表布局下暂停时进度条颜色显示不正确的bug +- 修复部分情况下509识别错误的bug +- 修复瀑布流布局下,历史页面无法删除单条历史记录的bug + +------------------------------------------------------------------------------------------ + +- Support hiding the quick back to top FAB +- Support marking outdated gallery torrents +- Now when the gallery image fails to load, it will automatically try to reparse other nodes +- Optimize the status update logic of tag rating +- Optimize gallery title in details page +- Optimized some network error information +- Optimize the display of log page +- Optimize tag search +- Optimize history record reading performance +- Optimize the performance of the download page list layout, support disable list animation +- Use gallery title in list page for download +- Fix the bug that the status is not updated after rating +- Fix UI bug when refreshing the details page +- Fix the bug of deleting local gallery in some scenarios +- Fix the bug that super-resolution images cannot be deleted +- Fix the bug that super-resolution images cannot be generated in some cases +- Fix the routing bug when clicking tag search when closing tag search inheritance +- Fix the bug that the progress bar color is displayed incorrectly when pausing in the download page list layout +- Fix the bug of 509 recognition error in some cases +- Fix the bug that the history page cannot delete a single history record in the waterfall flow layout \ No newline at end of file diff --git a/changelog/v7.4.13.md b/changelog/v7.4.13.md index fc5cc8a12..fb9c94087 100644 --- a/changelog/v7.4.13.md +++ b/changelog/v7.4.13.md @@ -1,43 +1,5 @@ -- 支持隐藏快速回顶按钮 -- 支持标记出已过期的画廊种子 -- 现在画廊图片加载失败时,会自动尝试重新解析其他节点 -- 优化标签评分的状态更新逻辑 -- 优化详情页标题 -- 优化部分网络错误的提示文案 -- 优化日志页的显示 -- 优化标签搜索 -- 优化历史记录读取性能 -- 优化下载页列表布局的性能,支持取消列表动画 -- 下载时优先使用列表页的标题 -- 修复评分画廊后UI状态未更新的bug -- 修复详情页刷新时的UI bug -- 修复部分场景下删除本地画廊时的bug -- 修复无法删除超分图片的bug -- 修复部分情况下无法超分图片的bug -- 修复在关闭标签搜索继承时点击tag搜索时的路由bug -- 修复下载页列表布局下暂停时进度条颜色显示不正确的bug -- 修复部分情况下509识别错误的bug -- 修复瀑布流布局下,历史页面无法删除单条历史记录的bug +- 修复部分场景下无法投票评论、新增评论的bug ------------------------------------------------------------------------------------------ -- Support hiding the quick back to top FAB -- Support marking outdated gallery torrents -- Now when the gallery image fails to load, it will automatically try to reparse other nodes -- Optimize the status update logic of tag rating -- Optimize gallery title in details page -- Optimized some network error information -- Optimize the display of log page -- Optimize tag search -- Optimize history record reading performance -- Optimize the performance of the download page list layout, support disable list animation -- Use gallery title in list page for download -- Fix the bug that the status is not updated after rating -- Fix UI bug when refreshing the details page -- Fix the bug of deleting local gallery in some scenarios -- Fix the bug that super-resolution images cannot be deleted -- Fix the bug that super-resolution images cannot be generated in some cases -- Fix the routing bug when clicking tag search when closing tag search inheritance -- Fix the bug that the progress bar color is displayed incorrectly when pausing in the download page list layout -- Fix the bug of 509 recognition error in some cases -- Fix the bug that the history page cannot delete a single history record in the waterfall flow layout \ No newline at end of file +- Fix the bug that cannot vote or add comments in some scenarios \ No newline at end of file diff --git a/lib/src/pages/details/comment/comment_page.dart b/lib/src/pages/details/comment/comment_page.dart index 2f1ec5567..3d8bfa8ef 100644 --- a/lib/src/pages/details/comment/comment_page.dart +++ b/lib/src/pages/details/comment/comment_page.dart @@ -77,7 +77,7 @@ class _CommentPageState extends State with LoginRequiredMixin { } List newComments = await EHRequest.requestDetailPage( - galleryUrl: DetailsPageLogic.current!.state.gallery!.galleryUrl.url, + galleryUrl: DetailsPageLogic.current!.state.galleryDetails?.galleryUrl.url ?? DetailsPageLogic.current!.state.gallery!.galleryUrl.url, parser: EHSpiderParser.detailPage2Comments, useCacheIfAvailable: false, ); @@ -113,7 +113,7 @@ class _CommentPageState extends State with LoginRequiredMixin { } List newComments = await EHRequest.requestDetailPage( - galleryUrl: DetailsPageLogic.current!.state.gallery!.galleryUrl.url, + galleryUrl: DetailsPageLogic.current!.state.galleryDetails?.galleryUrl.url ?? DetailsPageLogic.current!.state.gallery!.galleryUrl.url, parser: EHSpiderParser.detailPage2Comments, useCacheIfAvailable: false, ); diff --git a/lib/src/pages/details/comment/eh_comment.dart b/lib/src/pages/details/comment/eh_comment.dart index adae037f7..fd4581963 100644 --- a/lib/src/pages/details/comment/eh_comment.dart +++ b/lib/src/pages/details/comment/eh_comment.dart @@ -478,8 +478,8 @@ class _EHCommentFooterState extends State<_EHCommentFooter> with LoginRequiredMi try { newScore = await EHRequest.voteComment( - detailsPageState.gallery!.gid, - detailsPageState.gallery!.token, + detailsPageState.galleryDetails?.galleryUrl.gid ?? detailsPageState.gallery!.gid, + detailsPageState.galleryDetails?.galleryUrl.token ?? detailsPageState.gallery!.token, UserSetting.ipbMemberId.value!, detailsPageState.apikey!, widget.commentId, diff --git a/lib/src/pages/details/details_page.dart b/lib/src/pages/details/details_page.dart index cb98824ea..0aa0bddf8 100644 --- a/lib/src/pages/details/details_page.dart +++ b/lib/src/pages/details/details_page.dart @@ -34,7 +34,6 @@ import '../../database/database.dart'; import '../../mixin/scroll_to_top_logic_mixin.dart'; import '../../mixin/scroll_to_top_state_mixin.dart'; import '../../service/gallery_download_service.dart'; -import '../../service/local_gallery_service.dart'; import '../../setting/preference_setting.dart'; import '../../setting/style_setting.dart'; import '../../utils/date_util.dart'; diff --git a/lib/src/pages/details/thumbnails/thumbnails_page.dart b/lib/src/pages/details/thumbnails/thumbnails_page.dart index 2c7ca3f02..26e3be829 100644 --- a/lib/src/pages/details/thumbnails/thumbnails_page.dart +++ b/lib/src/pages/details/thumbnails/thumbnails_page.dart @@ -30,6 +30,14 @@ class ThumbnailsPage extends StatelessWidget with Scroll2TopPageMixin { ThumbnailsPage({Key? key}) : super(key: key); + String get _mainTitleText => + logic.detailsPageState.gallery?.title ?? + logic.detailsPageState.galleryDetails?.japaneseTitle ?? + logic.detailsPageState.galleryDetails?.rawTitle ?? + logic.detailsPageState.galleryMetadata?.japaneseTitle ?? + logic.detailsPageState.galleryMetadata?.title ?? + ''; + @override Widget build(BuildContext context) { return GetBuilder( @@ -44,7 +52,7 @@ class ThumbnailsPage extends StatelessWidget with Scroll2TopPageMixin { AppBar buildAppBar() { return AppBar( - title: Text(logic.detailsPageState.gallery?.title ?? '', style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), + title: Text(_mainTitleText, style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), actions: [ IconButton( icon: const Icon(FontAwesomeIcons.paperPlane, size: 21), @@ -84,7 +92,7 @@ class ThumbnailsPage extends StatelessWidget with Scroll2TopPageMixin { SchedulerBinding.instance.addPostFrameCallback((_) => logic.loadMoreThumbnails()); } - GalleryImage? downloadedImage = logic.detailsPageLogic.galleryDownloadService.galleryDownloadInfos[logic.detailsPageState.gallery!.gid] + GalleryImage? downloadedImage = logic.detailsPageLogic.galleryDownloadService.galleryDownloadInfos[logic.detailsPageState.galleryDetails!.galleryUrl.gid] ?.images[state.absoluteIndexOfThumbnails[index]]; return KeepAliveWrapper( diff --git a/lib/src/widget/eh_comment_dialog.dart b/lib/src/widget/eh_comment_dialog.dart index a51e3c118..1c6d6dbab 100644 --- a/lib/src/widget/eh_comment_dialog.dart +++ b/lib/src/widget/eh_comment_dialog.dart @@ -87,7 +87,7 @@ class EHCommentDialogState extends State { try { if (widget.type == CommentDialogType.add) { errMsg = await EHRequest.requestSendComment( - galleryUrl: DetailsPageLogic.current!.state.gallery!.galleryUrl.url, + galleryUrl: DetailsPageLogic.current!.state.galleryDetails?.galleryUrl.url ?? DetailsPageLogic.current!.state.gallery!.galleryUrl.url, content: content, parser: EHSpiderParser.sendComment2ErrorMsg, ); @@ -95,7 +95,7 @@ class EHCommentDialogState extends State { if (widget.type == CommentDialogType.update) { errMsg = await EHRequest.requestUpdateComment( - galleryUrl: DetailsPageLogic.current!.state.gallery!.galleryUrl.url, + galleryUrl: DetailsPageLogic.current!.state.galleryDetails?.galleryUrl.url ?? DetailsPageLogic.current!.state.gallery!.galleryUrl.url, commentId: widget.commentId!, content: content, parser: EHSpiderParser.sendComment2ErrorMsg, diff --git a/pubspec.yaml b/pubspec.yaml index 141355fd8..2438ff3e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: jhentai description: A flutter app for E-Hentai/EXHentai publish_to: 'none' -version: 7.4.13+175 +version: 7.4.13+176 environment: sdk: '>=3.0.0 <4.0.0'