Skip to content

Commit

Permalink
v7.4.10+149
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed Dec 31, 2023
1 parent 9de4bc6 commit 88e73c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
5 changes: 5 additions & 0 deletions changelog/v7.4.10+149.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- 修复v7.4.8中引入的里站访问bug

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

- Fix the bug of accessing the EX site introduced in v7.4.8
6 changes: 3 additions & 3 deletions lib/src/pages/details/details_page_logic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ class DetailsPageLogic extends GetxController with LoginRequiredMixin, Scroll2To
);
state.gallery?.galleryUrl = state.galleryUrl = firstLink;
return galleryAndDetailAndApikey;
} on DioError catch (e) {
if (e.response?.statusCode != 404) {
} on EHException catch (e) {
if (e.type != EHExceptionType.galleryDeleted) {
rethrow;
}
Log.verbose('Can\'t find gallery, firstLink: $firstLink');
Expand All @@ -770,7 +770,7 @@ class DetailsPageLogic extends GetxController with LoginRequiredMixin, Scroll2To
);
state.gallery?.galleryUrl = state.galleryUrl = secondLink;
return galleryAndDetailAndApikey;
} on DioError catch (_) {
} on EHException catch (_) {
Log.verbose('Can\'t find gallery, secondLink: $secondLink');
rethrow;
}
Expand Down
16 changes: 7 additions & 9 deletions lib/src/widget/eh_gallery_stat_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,18 @@ class _EHGalleryStatDialogState extends State<EHGalleryStatDialog> {
parser: EHSpiderParser.statPage2GalleryStats,
);
} on DioError catch (e) {
if (e.response?.statusCode == 404) {
Log.info('invisible2UserWithoutDonation'.tr);
if (mounted) {
setState(() => loadingState = LoadingState.noData);
}
return;
}

Log.error('getGalleryStatisticsFailed'.tr, e.message);
snack('getGalleryStatisticsFailed'.tr, e.message);
setStateSafely(() => loadingState = LoadingState.error);

return;
} on EHException catch (e) {
if (e.type == EHExceptionType.galleryDeleted) {
Log.error('invisible2UserWithoutDonation'.tr);
snack('invisible2UserWithoutDonation'.tr, e.message);
setStateSafely(() => loadingState = LoadingState.noData);
return;
}

Log.error('getGalleryStatisticsFailed'.tr, e.message);
snack('getGalleryStatisticsFailed'.tr, e.message);
setStateSafely(() => loadingState = LoadingState.error);
Expand Down

0 comments on commit 88e73c4

Please sign in to comment.