From 979395eaaf295026a56be12c1440b420bba1169a 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: Thu, 7 Nov 2024 23:28:05 +0800 Subject: [PATCH] Fix the bug that the tags of downloaded galleries cannot be automatically updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复无法自动更新已下载画廊标签的bug --- changelog/v8.0.6.md | 5 ++++- lib/src/model/gallery_metadata.dart | 2 -- lib/src/service/log.dart | 6 +++--- lib/src/service/schedule_service.dart | 4 ++-- lib/src/utils/eh_spider_parser.dart | 2 -- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/changelog/v8.0.6.md b/changelog/v8.0.6.md index 266b96098..83281a4ba 100644 --- a/changelog/v8.0.6.md +++ b/changelog/v8.0.6.md @@ -8,6 +8,7 @@ - 修复移动端退出主路由的问题 - 修复阅读页重载图片后,本地缓存未更新的bug - 修复阅读页切换为双列模式时页面渲染异常的bug +- 修复无法自动更新已下载画廊标签的bug -------------------- @@ -20,4 +21,6 @@ - Remove the gesture of tag drag to scale in read page - Remove the gesture of dragging and zooming after clicking on the reading page - Fix the problem of exiting the main route on the mobile terminal -- Fix the bug that the local cache is not updated after reloading the image on the reading page \ No newline at end of file +- Fix the bug that the local cache is not updated after reloading the image on the reading page +- Fix the bug that the page rendering is abnormal when switching to double-column mode on the reading page +- Fix the bug that the tags of downloaded galleries cannot be automatically updated \ No newline at end of file diff --git a/lib/src/model/gallery_metadata.dart b/lib/src/model/gallery_metadata.dart index 1ae55d105..10b581c9b 100644 --- a/lib/src/model/gallery_metadata.dart +++ b/lib/src/model/gallery_metadata.dart @@ -6,7 +6,6 @@ import 'package:jhentai/src/model/gallery_url.dart'; class GalleryMetadata { GalleryUrl galleryUrl; - String archiveKey; String title; String japaneseTitle; String category; @@ -26,7 +25,6 @@ class GalleryMetadata { GalleryMetadata({ required this.galleryUrl, - required this.archiveKey, required this.title, required this.japaneseTitle, required this.category, diff --git a/lib/src/service/log.dart b/lib/src/service/log.dart index 8d910ebdb..15eaed562 100644 --- a/lib/src/service/log.dart +++ b/lib/src/service/log.dart @@ -79,9 +79,9 @@ class LogService with JHLifeCircleBeanErrorCatch implements JHLifeCircleBean { void warning(Object msg, [Object? error, bool withStack = false]) async { await _initLogger(); - _consoleLogger?.w(msg, stackTrace: withStack ? null : StackTrace.empty); - _verboseFileLogger?.w(msg, stackTrace: withStack ? null : StackTrace.empty); - _warningFileLogger?.w(msg, stackTrace: withStack ? null : StackTrace.empty); + _consoleLogger?.w(msg, error: error, stackTrace: withStack ? null : StackTrace.empty); + _verboseFileLogger?.w(msg, error: error, stackTrace: withStack ? null : StackTrace.empty); + _warningFileLogger?.w(msg, error: error, stackTrace: withStack ? null : StackTrace.empty); } void error(Object msg, [Object? error, StackTrace? stackTrace]) async { diff --git a/lib/src/service/schedule_service.dart b/lib/src/service/schedule_service.dart index 7b0853b51..89abebba8 100644 --- a/lib/src/service/schedule_service.dart +++ b/lib/src/service/schedule_service.dart @@ -112,7 +112,7 @@ class ScheduleService with JHLifeCircleBeanErrorCatch implements JHLifeCircleBea ); log.trace('refreshGalleryTags success, pageNo: $pageNo, archives: ${gallerys.map((a) => a.gid).toList()}'); } catch (e) { - log.warning('refreshGalleryTags error, gallerys: ${gallerys.map((a) => (gid: a.gid, token: a.token)).toList()}', e); + log.warning('refreshGalleryTags error, gallerys: ${gallerys.map((a) => (gid: a.gid, token: a.token)).toList()}', e, true); } pageNo++; @@ -143,7 +143,7 @@ class ScheduleService with JHLifeCircleBeanErrorCatch implements JHLifeCircleBea ); log.trace('refreshArchiveTags success, pageNo: $pageNo, archives: ${archives.map((a) => a.gid).toList()}'); } catch (e) { - log.warning('refreshArchiveTags error, archives: ${archives.map((a) => a.gid).toList()}', e); + log.warning('refreshArchiveTags error, archives: ${archives.map((a) => a.gid).toList()}', e, true); } pageNo++; diff --git a/lib/src/utils/eh_spider_parser.dart b/lib/src/utils/eh_spider_parser.dart index c8bc0442a..e1179b053 100644 --- a/lib/src/utils/eh_spider_parser.dart +++ b/lib/src/utils/eh_spider_parser.dart @@ -433,7 +433,6 @@ class EHSpiderParser { return GalleryMetadata( galleryUrl: GalleryUrl(isEH: true, gid: map['gid'], token: map['token']), - archiveKey: map['archiver_key'], title: map['title'], japaneseTitle: map['title_jpn'], category: map['category'], @@ -470,7 +469,6 @@ class EHSpiderParser { return GalleryMetadata( galleryUrl: GalleryUrl(isEH: true, gid: item['gid'], token: item['token']), - archiveKey: item['archiver_key'], title: item['title'], japaneseTitle: item['title_jpn'], category: item['category'],