Skip to content

Commit 7efe5a4

Browse files
committed
redirect
1 parent f55d1d9 commit 7efe5a4

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

lib/src/network/eh_timeout_translator.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import 'package:dio/dio.dart';
22
import 'package:get/get.dart';
3+
import 'package:jhentai/src/setting/network_setting.dart';
34

45
class EHTimeoutTranslator extends Interceptor {
56
@override
67
void onError(DioException err, ErrorInterceptorHandler handler) {
78
if (err.type == DioExceptionType.connectionTimeout) {
8-
return handler.next(err.copyWith(message: 'connectionTimeoutHint'.tr));
9+
return handler.next(err.copyWith(message: '${'connectionTimeoutHint'.tr} (${NetworkSetting.connectTimeout}ms)'));
910
}
1011
if (err.type == DioExceptionType.receiveTimeout) {
11-
return handler.next(err.copyWith(message: 'receiveDataTimeoutHint'.tr));
12+
return handler.next(err.copyWith(message: '${'receiveDataTimeoutHint'.tr} (${NetworkSetting.receiveTimeout}ms)'));
1213
}
1314
handler.next(err);
1415
}

lib/src/pages/details/details_page_logic.dart

+3-8
Original file line numberDiff line numberDiff line change
@@ -727,21 +727,16 @@ class DetailsPageLogic extends GetxController with LoginRequiredMixin, Scroll2To
727727
/// 1. if redirect is enabled, try EH site first for EX link
728728
/// 2. if a gallery can't be found in EH site, it may be moved into EX site
729729
if (state.galleryUrl.contains(EHConsts.EXIndex)) {
730-
if (EHSetting.redirect2Eh.isTrue) {
730+
if (EHSetting.redirect2Eh.isTrue && !_galleryOnlyInExSite()) {
731731
firstLink = state.galleryUrl.replaceFirst(EHConsts.EXIndex, EHConsts.EHIndex);
732732
secondLink = state.galleryUrl;
733733
} else {
734734
firstLink = null;
735735
secondLink = state.galleryUrl;
736736
}
737737
} else {
738-
if (_galleryOnlyInExSite()) {
739-
firstLink = null;
740-
secondLink = state.galleryUrl.replaceFirst(EHConsts.EHIndex, EHConsts.EXIndex);
741-
} else {
742-
firstLink = state.galleryUrl;
743-
secondLink = state.galleryUrl.replaceFirst(EHConsts.EHIndex, EHConsts.EXIndex);
744-
}
738+
firstLink = state.galleryUrl;
739+
secondLink = state.galleryUrl.replaceFirst(EHConsts.EHIndex, EHConsts.EXIndex);
745740
}
746741

747742
/// if we can't find gallery via firstLink, try second link

macos/Podfile.lock

+6-15
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,10 @@ PODS:
1414
- path_provider_foundation (0.0.1):
1515
- Flutter
1616
- FlutterMacOS
17-
- screen_retriever (0.0.1):
17+
- screen_brightness_macos (0.1.0):
1818
- FlutterMacOS
19-
- Sentry/HybridSDK (8.9.1):
20-
- SentryPrivate (= 8.9.1)
21-
- sentry_flutter (0.0.1):
22-
- Flutter
19+
- screen_retriever (0.0.1):
2320
- FlutterMacOS
24-
- Sentry/HybridSDK (= 8.9.1)
25-
- SentryPrivate (8.9.1)
2621
- share_plus_macos (0.0.1):
2722
- FlutterMacOS
2823
- smart_auth (0.0.1):
@@ -62,8 +57,8 @@ DEPENDENCIES:
6257
- just_audio (from `Flutter/ephemeral/.symlinks/plugins/just_audio/macos`)
6358
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
6459
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
60+
- screen_brightness_macos (from `Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos`)
6561
- screen_retriever (from `Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos`)
66-
- sentry_flutter (from `Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos`)
6762
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
6863
- smart_auth (from `Flutter/ephemeral/.symlinks/plugins/smart_auth/macos`)
6964
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
@@ -75,8 +70,6 @@ DEPENDENCIES:
7570
SPEC REPOS:
7671
trunk:
7772
- FMDB
78-
- Sentry
79-
- SentryPrivate
8073
- sqlite3
8174

8275
EXTERNAL SOURCES:
@@ -92,10 +85,10 @@ EXTERNAL SOURCES:
9285
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
9386
path_provider_foundation:
9487
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
88+
screen_brightness_macos:
89+
:path: Flutter/ephemeral/.symlinks/plugins/screen_brightness_macos/macos
9590
screen_retriever:
9691
:path: Flutter/ephemeral/.symlinks/plugins/screen_retriever/macos
97-
sentry_flutter:
98-
:path: Flutter/ephemeral/.symlinks/plugins/sentry_flutter/macos
9992
share_plus_macos:
10093
:path: Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos
10194
smart_auth:
@@ -119,10 +112,8 @@ SPEC CHECKSUMS:
119112
just_audio: 9b67ca7b97c61cfc9784ea23cd8cc55eb226d489
120113
package_info_plus: 02d7a575e80f194102bef286361c6c326e4c29ce
121114
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
115+
screen_brightness_macos: 2d6d3af2165592d9a55ffcd95b7550970e41ebda
122116
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
123-
Sentry: e3203780941722a1fcfee99e351de14244c7f806
124-
sentry_flutter: 8f0ffd53088e6a4d50c095852c5cad9e4405025c
125-
SentryPrivate: 5e3683390f66611fc7c6215e27645873adb55d13
126117
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4
127118
smart_auth: b38e3ab4bfe089eacb1e233aca1a2340f96c28e9
128119
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea

0 commit comments

Comments
 (0)