diff --git a/changelog/v7.5.4+222.md b/changelog/v7.5.4+222.md new file mode 100644 index 00000000..74ae6497 --- /dev/null +++ b/changelog/v7.5.4+222.md @@ -0,0 +1,5 @@ +- 修复评论解析、收藏解析 + +------------------------------------------------------------------------------------------ + +- Fix comment and favorites parsing \ No newline at end of file diff --git a/lib/src/pages/base/base_page_logic.dart b/lib/src/pages/base/base_page_logic.dart index c95254cf..4c60ea84 100644 --- a/lib/src/pages/base/base_page_logic.dart +++ b/lib/src/pages/base/base_page_logic.dart @@ -23,6 +23,7 @@ import '../../utils/log.dart'; import '../../utils/route_util.dart'; import '../../utils/snack_util.dart'; import '../../utils/toast_util.dart'; +import '../../utils/uuid_util.dart'; import '../../widget/loading_state_indicator.dart'; import '../details/details_page_logic.dart'; import 'base_page_state.dart'; @@ -123,7 +124,7 @@ abstract class BasePageLogic extends GetxController with Scroll2TopLogicMixin { state.prevGid = galleryPage.prevGid; state.nextGid = galleryPage.nextGid; state.favoriteSortOrder = galleryPage.favoriteSortOrder; - state.galleryCollectionKey = UniqueKey(); + state.galleryCollectionKey = Key(newUUID()); state.refreshState = LoadingState.idle; @@ -309,7 +310,7 @@ abstract class BasePageLogic extends GetxController with Scroll2TopLogicMixin { state.prevGid = galleryPage.prevGid; state.nextGid = galleryPage.nextGid; state.favoriteSortOrder = galleryPage.favoriteSortOrder; - state.galleryCollectionKey = UniqueKey(); + state.galleryCollectionKey = Key(newUUID()); state.seek = dateTime; diff --git a/lib/src/pages/base/base_page_state.dart b/lib/src/pages/base/base_page_state.dart index 381343af..b4d4c01e 100644 --- a/lib/src/pages/base/base_page_state.dart +++ b/lib/src/pages/base/base_page_state.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:jhentai/src/mixin/scroll_to_top_state_mixin.dart'; import 'package:jhentai/src/model/gallery_count.dart'; import 'package:jhentai/src/model/search_config.dart'; +import 'package:jhentai/src/utils/uuid_util.dart'; import '../../model/gallery.dart'; import '../../model/gallery_page.dart'; @@ -31,7 +32,7 @@ abstract class BasePageState with Scroll2TopStateMixin { LoadingState loadingState = LoadingState.idle; /// used for refresh - Key galleryCollectionKey = UniqueKey(); + Key galleryCollectionKey = Key(newUUID()); late PageStorageKey pageStorageKey; diff --git a/lib/src/pages/base/old_base_page_logic.dart b/lib/src/pages/base/old_base_page_logic.dart index c4cb3f3b..4cb5b0a1 100644 --- a/lib/src/pages/base/old_base_page_logic.dart +++ b/lib/src/pages/base/old_base_page_logic.dart @@ -10,6 +10,7 @@ import '../../mixin/scroll_to_top_state_mixin.dart'; import '../../model/gallery.dart'; import '../../utils/log.dart'; import '../../utils/snack_util.dart'; +import '../../utils/uuid_util.dart'; import '../../widget/jump_page_dialog.dart'; import '../../widget/loading_state_indicator.dart'; import 'old_base_page_state.dart'; @@ -83,7 +84,7 @@ abstract class OldBasePageLogic extends BasePageLogic { state.pageCount = gallerysAndPageInfo[1]; state.prevPageIndexToLoad = gallerysAndPageInfo[2]; state.nextPageIndexToLoad = gallerysAndPageInfo[3]; - state.galleryCollectionKey = UniqueKey(); + state.galleryCollectionKey = Key(newUUID()); state.refreshState = LoadingState.idle; if (state.pageCount == 0) { diff --git a/lib/src/pages/details/comment/comment_page.dart b/lib/src/pages/details/comment/comment_page.dart index 29e98a66..8168318c 100644 --- a/lib/src/pages/details/comment/comment_page.dart +++ b/lib/src/pages/details/comment/comment_page.dart @@ -8,12 +8,12 @@ import 'package:jhentai/src/pages/details/details_page_logic.dart'; import 'package:jhentai/src/pages/details/comment/eh_comment.dart'; import 'package:jhentai/src/utils/toast_util.dart'; import 'package:jhentai/src/widget/eh_wheel_speed_controller.dart'; -import 'package:uuid/v1.dart'; import '../../../mixin/login_required_logic_mixin.dart'; import '../../../service/local_block_rule_service.dart'; import '../../../setting/user_setting.dart'; import '../../../utils/eh_spider_parser.dart'; +import '../../../utils/uuid_util.dart'; import '../../../widget/eh_comment_dialog.dart'; class CommentPage extends StatefulWidget { @@ -176,7 +176,7 @@ class _CommentPageState extends State with LoginRequiredMixin { Future _onBlockUser(GalleryComment comment) async { await localBlockRuleService.upsertBlockRule( LocalBlockRule( - groupId: const UuidV1().generate(), + groupId: newUUID(), target: LocalBlockTargetEnum.comment, attribute: LocalBlockAttributeEnum.userName, pattern: LocalBlockPatternEnum.equal, @@ -186,7 +186,7 @@ class _CommentPageState extends State with LoginRequiredMixin { if (comment.userId != null) { await localBlockRuleService.upsertBlockRule( LocalBlockRule( - groupId: const UuidV1().generate(), + groupId: newUUID(), target: LocalBlockTargetEnum.comment, attribute: LocalBlockAttributeEnum.userId, pattern: LocalBlockPatternEnum.equal, diff --git a/lib/src/pages/details/details_page.dart b/lib/src/pages/details/details_page.dart index 99d56476..18a38b84 100644 --- a/lib/src/pages/details/details_page.dart +++ b/lib/src/pages/details/details_page.dart @@ -19,6 +19,7 @@ import 'package:jhentai/src/pages/details/comment/eh_comment.dart'; import 'package:jhentai/src/pages/download/download_base_page.dart'; import 'package:jhentai/src/routes/routes.dart'; import 'package:jhentai/src/service/archive_download_service.dart'; +import 'package:jhentai/src/utils/uuid_util.dart'; import 'package:jhentai/src/widget/eh_gallery_detail_dialog.dart'; import 'package:jhentai/src/widget/eh_image.dart'; import 'package:jhentai/src/widget/eh_tag.dart'; @@ -41,7 +42,7 @@ import 'details_page_logic.dart'; import 'details_page_state.dart'; class DetailsPage extends StatelessWidget with Scroll2TopPageMixin { - final String tag = UniqueKey().toString(); + final String tag = newUUID(); late final DetailsPageLogic logic; late final DetailsPageState state; diff --git a/lib/src/pages/details/details_page_logic.dart b/lib/src/pages/details/details_page_logic.dart index 2380d7fc..435c79d2 100644 --- a/lib/src/pages/details/details_page_logic.dart +++ b/lib/src/pages/details/details_page_logic.dart @@ -81,6 +81,11 @@ class DetailsPageArgument { final ({GalleryDetail galleryDetails, String apikey})? detailsPageInfo; const DetailsPageArgument({required this.galleryUrl, this.gallery, this.detailsPageInfo}); + + @override + String toString() { + return 'DetailsPageArgument{galleryUrl: $galleryUrl, gallery: $gallery, detailsPageInfo: $detailsPageInfo}'; + } } class DetailsPageLogic extends GetxController with LoginRequiredMixin, Scroll2TopLogicMixin, UpdateGlobalGalleryStatusLogicMixin { diff --git a/lib/src/pages/search/desktop/desktop_search_page_logic.dart b/lib/src/pages/search/desktop/desktop_search_page_logic.dart index ba7624d4..2a58a15a 100644 --- a/lib/src/pages/search/desktop/desktop_search_page_logic.dart +++ b/lib/src/pages/search/desktop/desktop_search_page_logic.dart @@ -8,6 +8,7 @@ import 'package:jhentai/src/pages/search/desktop/desktop_search_page_state.dart' import '../../../mixin/scroll_to_top_logic_mixin.dart'; import '../../../mixin/scroll_to_top_state_mixin.dart'; +import '../../../utils/uuid_util.dart'; import 'desktop_search_page_tab_logic.dart'; import 'desktop_search_page_tab_view.dart'; @@ -49,7 +50,7 @@ class DesktopSearchPageLogic extends GetxController with Scroll2TopLogicMixin { state.currentTabIndex = state.tabs.length - 1; state.pageController = PageController(initialPage: state.currentTabIndex); - state.tabViewKey = UniqueKey(); + state.tabViewKey = Key(newUUID()); updateSafely([pageId]); state.tabController.jumpTo(state.tabController.position.maxScrollExtent); @@ -78,7 +79,7 @@ class DesktopSearchPageLogic extends GetxController with Scroll2TopLogicMixin { if (index == state.currentTabIndex) { state.currentTabIndex = min(state.tabs.length - 1, state.currentTabIndex); state.pageController = PageController(initialPage: state.currentTabIndex); - state.tabViewKey = UniqueKey(); + state.tabViewKey = Key(newUUID()); updateSafely([pageId]); } diff --git a/lib/src/pages/search/desktop/desktop_search_page_state.dart b/lib/src/pages/search/desktop/desktop_search_page_state.dart index 5dc5f5a6..f9121ad8 100644 --- a/lib/src/pages/search/desktop/desktop_search_page_state.dart +++ b/lib/src/pages/search/desktop/desktop_search_page_state.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:jhentai/src/pages/search/desktop/desktop_search_page_tab_logic.dart'; import '../../../mixin/scroll_to_top_state_mixin.dart'; +import '../../../utils/uuid_util.dart'; import 'desktop_search_page_tab_view.dart'; class DesktopSearchPageState with Scroll2TopStateMixin { @@ -10,7 +11,7 @@ class DesktopSearchPageState with Scroll2TopStateMixin { int currentTabIndex = 0; PageController pageController = PageController(); - Key tabViewKey = UniqueKey(); + Key tabViewKey = Key(newUUID()); ScrollController tabController = ScrollController(); diff --git a/lib/src/pages/search/mobile_v2/search_page_mobile_v2.dart b/lib/src/pages/search/mobile_v2/search_page_mobile_v2.dart index 87905832..5b4f9607 100644 --- a/lib/src/pages/search/mobile_v2/search_page_mobile_v2.dart +++ b/lib/src/pages/search/mobile_v2/search_page_mobile_v2.dart @@ -6,6 +6,7 @@ import 'package:jhentai/src/pages/search/mobile_v2/search_page_mobile_v2_state.d import 'package:jhentai/src/routes/routes.dart'; import 'package:jhentai/src/setting/preference_setting.dart'; import 'package:jhentai/src/utils/route_util.dart'; +import 'package:jhentai/src/utils/uuid_util.dart'; import '../../base/base_page.dart'; import '../mixin/search_page_mixin.dart'; @@ -14,7 +15,7 @@ import '../quick_search/quick_search_page.dart'; class SearchPageMobileV2 extends BasePage with SearchPageMixin { - final String tag = UniqueKey().toString(); + final String tag = newUUID(); final GlobalKey scaffoldKey = GlobalKey(); SearchPageMobileV2({Key? key}) : super(key: key, showJumpButton: true, showScroll2TopButton: true) { diff --git a/lib/src/pages/setting/preference/block_rule/add_block_rule/configure_blocking_rule_page_logic.dart b/lib/src/pages/setting/preference/block_rule/add_block_rule/configure_blocking_rule_page_logic.dart index 68c3763b..313353af 100644 --- a/lib/src/pages/setting/preference/block_rule/add_block_rule/configure_blocking_rule_page_logic.dart +++ b/lib/src/pages/setting/preference/block_rule/add_block_rule/configure_blocking_rule_page_logic.dart @@ -2,11 +2,11 @@ import 'package:get/get.dart'; import 'package:jhentai/src/extension/get_logic_extension.dart'; import 'package:jhentai/src/routes/routes.dart'; import 'package:jhentai/src/utils/route_util.dart'; -import 'package:uuid/v1.dart'; import '../../../../../service/local_block_rule_service.dart'; import '../../../../../utils/snack_util.dart'; import '../../../../../utils/toast_util.dart'; +import '../../../../../utils/uuid_util.dart'; import 'configure_blocking_rule_page_state.dart'; enum ConfigureBlockingRulePageMode { add, edit } @@ -29,7 +29,7 @@ class ConfigureBlockingRulePageLogic extends GetxController { void onInit() { ConfigureBlockingRulePageArgument argument = Get.arguments; if (argument.groupRules == null) { - state.groupId = const UuidV1().generate(); + state.groupId = newUUID(); state.rules.add( LocalBlockRule( target: LocalBlockTargetEnum.gallery, diff --git a/lib/src/service/app_update_service.dart b/lib/src/service/app_update_service.dart index cc1e7bdc..501eda0a 100644 --- a/lib/src/service/app_update_service.dart +++ b/lib/src/service/app_update_service.dart @@ -14,7 +14,6 @@ import 'package:jhentai/src/setting/read_setting.dart'; import 'package:jhentai/src/setting/super_resolution_setting.dart'; import 'package:jhentai/src/utils/string_uril.dart'; import 'package:path/path.dart'; -import 'package:uuid/v1.dart'; import '../database/database.dart'; import '../pages/search/mixin/search_page_logic_mixin.dart'; @@ -22,6 +21,7 @@ import '../setting/download_setting.dart'; import '../setting/preference_setting.dart'; import '../utils/locale_util.dart'; import '../utils/log.dart'; +import '../utils/uuid_util.dart'; class AppUpdateService extends GetxService { static const int appVersion = 10; @@ -204,7 +204,7 @@ class AppUpdateService extends GetxService { if (oldVersion <= 9) { Log.info('Migrate local filtered tags'); - + Map? map = Get.find().read>('MyTagsSetting'); if (map != null) { LocalBlockRuleService localBlockRuleService = Get.find(); @@ -212,7 +212,7 @@ class AppUpdateService extends GetxService { for (TagData tagData in localTagSets) { localBlockRuleService.upsertBlockRule( LocalBlockRule( - groupId: const UuidV1().generate(), + groupId: newUUID(), target: LocalBlockTargetEnum.gallery, attribute: LocalBlockAttributeEnum.tag, pattern: LocalBlockPatternEnum.equal, @@ -222,7 +222,7 @@ class AppUpdateService extends GetxService { if (tagData.translatedNamespace != null && tagData.tagName != null) { localBlockRuleService.upsertBlockRule( LocalBlockRule( - groupId: const UuidV1().generate(), + groupId: newUUID(), target: LocalBlockTargetEnum.gallery, attribute: LocalBlockAttributeEnum.tag, pattern: LocalBlockPatternEnum.equal, diff --git a/lib/src/utils/uuid_util.dart b/lib/src/utils/uuid_util.dart new file mode 100644 index 00000000..66da58a0 --- /dev/null +++ b/lib/src/utils/uuid_util.dart @@ -0,0 +1,7 @@ +import 'package:uuid/v1.dart'; + +const UuidV1 uuid = UuidV1(); + +String newUUID() { + return uuid.generate(); +} diff --git a/pubspec.yaml b/pubspec.yaml index 634b4ac5..0b030805 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.5.4+221 +version: 7.5.4+222 environment: sdk: '>=3.0.0 <4.0.0'