From 84a6a584d6d49d44f9325e9d95e16598ad7fdad3 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, 21 May 2024 15:01:17 +0800 Subject: [PATCH] Fix comment and favorites parsing --- changelog/v7.5.4+221.md | 5 +++++ lib/src/model/gallery_note.dart | 6 +----- lib/src/utils/eh_spider_parser.dart | 3 +-- pubspec.yaml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 changelog/v7.5.4+221.md diff --git a/changelog/v7.5.4+221.md b/changelog/v7.5.4+221.md new file mode 100644 index 00000000..74ae6497 --- /dev/null +++ b/changelog/v7.5.4+221.md @@ -0,0 +1,5 @@ +- 修复评论解析、收藏解析 + +------------------------------------------------------------------------------------------ + +- Fix comment and favorites parsing \ No newline at end of file diff --git a/lib/src/model/gallery_note.dart b/lib/src/model/gallery_note.dart index 39410321..b5fb6a71 100644 --- a/lib/src/model/gallery_note.dart +++ b/lib/src/model/gallery_note.dart @@ -1,9 +1,5 @@ class GalleryNote { final String note; - final int usedSlot; - - bool get isFull => usedSlot >= 1000; - - const GalleryNote({required this.note, required this.usedSlot}); + const GalleryNote({required this.note}); } diff --git a/lib/src/utils/eh_spider_parser.dart b/lib/src/utils/eh_spider_parser.dart index e4b689a4..d0b8cfb8 100644 --- a/lib/src/utils/eh_spider_parser.dart +++ b/lib/src/utils/eh_spider_parser.dart @@ -466,9 +466,8 @@ class EHSpiderParser { /// 1 / 1000 favorite note slots used. [?] String usedSlotDesc = document.querySelector('#galpop > div > div:nth-child(3) > div:nth-child(6)')!.text; - int usedSlot = int.parse(RegExp(r'(\d+) / 1000').firstMatch(usedSlotDesc)!.group(1)!); - return GalleryNote(note: note, usedSlot: usedSlot); + return GalleryNote(note: note); } static Map favoritePage2FavoriteTagsAndCounts(Headers headers, dynamic data) { diff --git a/pubspec.yaml b/pubspec.yaml index 4987b72c..634b4ac5 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+220 +version: 7.5.4+221 environment: sdk: '>=3.0.0 <4.0.0'