Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	changelog/v7.1.2+127.md
  • Loading branch information
jiangtian616 committed May 16, 2023
2 parents 9a62ef8 + 1e9c211 commit fce24ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
16 changes: 10 additions & 6 deletions changelog/v7.1.2+127.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
1. 修复里站画廊封面无法显示的问题
2. EH设置页中支持查看当前资产余额
3. EH设置页中支持重置图片配额
4. 修复归档dialog中gp和credit显示错误的bug
5. 正确处理在下载过程中画廊被删除的情况
6. 修复超分辨率图片初始化的bug
4. 搜索历史现在只会展示最多50条
5. Cookie登录优化,若igneous有效则自动切换至里站
6. 修复归档dialog中gp和credit显示错误的bug
7. 正确处理在下载过程中画廊被删除的情况
8. 修复超分辨率图片初始化的bug

------------------------------------------------------------------------------------------

1. Fix the bug that fail to load gallery cover
2. Display your credits and GP in EH Setting page
3. Support resetting image limit in EH Setting page
4. Fix the bug with gp & credit display in archive dialog
5. Fix the bug when a gallery is deleted while being downloaded
6. Fix the bug with super resolution
4. Search history now only displays up to 50 records
5. Optimization of Cookie login: if the igneous cookie is valid, automatically switch to EX site.
6. Fix the bug with gp & credit display in archive dialog
7. Fix the bug when a gallery is deleted while being downloaded
8. Fix the bug with super resolution
9 changes: 8 additions & 1 deletion lib/src/pages/setting/account/login/login_page_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:jhentai/src/widget/loading_state_indicator.dart';
import 'package:webview_flutter/webview_flutter.dart';

import '../../../../network/eh_cookie_manager.dart';
import '../../../../setting/eh_setting.dart';
import '../../../../utils/cookie_util.dart';
import '../../../../utils/log.dart';
import '../../../../utils/route_util.dart';
Expand Down Expand Up @@ -147,10 +148,13 @@ class LoginPageLogic extends GetxController {
Cookie('ipb_member_id', state.ipbMemberId!),
Cookie('ipb_pass_hash', state.ipbPassHash!),
]);
if (state.igneous != null) {

bool useEXSite = false;
if (state.igneous != null && state.igneous != 'null' && state.igneous != 'mystery') {
await cookieManager.storeEhCookiesForAllUri([
Cookie('igneous', state.igneous!),
]);
useEXSite = true;
}

/// control mobile keyboard
Expand Down Expand Up @@ -200,6 +204,9 @@ class LoginPageLogic extends GetxController {
state.loginState = LoadingState.success;
update([loadingStateId]);

if (useEXSite) {
EHSetting.site.value = 'EX';
}
UserSetting.saveUserInfo(
userName: userInfo['userName']!,
ipbMemberId: int.parse(state.ipbMemberId!),
Expand Down
8 changes: 6 additions & 2 deletions lib/src/service/search_history_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'package:get/get.dart';
import 'package:jhentai/src/model/search_history.dart';
import 'package:jhentai/src/service/storage_service.dart';
import 'package:jhentai/src/service/tag_translation_service.dart';
import 'package:jhentai/src/setting/style_setting.dart';
import 'package:jhentai/src/widget/loading_state_indicator.dart';

import '../database/database.dart';
import '../utils/log.dart';
Expand All @@ -14,6 +12,8 @@ class SearchHistoryService extends GetxService {

List<SearchHistory> histories = [];

static const _maxLength = 50;

static void init() {
Get.put(SearchHistoryService(), permanent: true);
}
Expand Down Expand Up @@ -41,6 +41,10 @@ class SearchHistoryService extends GetxService {
history.remove(searchHistory);
history.insert(0, searchHistory);

if (history.length > _maxLength) {
history = history.sublist(0, _maxLength);
}

storageService.write('searchHistory', history);

histories.removeWhere((history) => history.rawKeyword == searchHistory);
Expand Down

0 comments on commit fce24ab

Please sign in to comment.