From b1c62d462060fbdee0f305b10b90d4ecb68915f9 Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Thu, 12 Dec 2024 18:19:52 +0100 Subject: [PATCH] fix build after merge --- android/gradle/wrapper/gradle-wrapper.properties | 2 +- lib/services/jellyfin_api.chopper.dart | 1 - lib/services/jellyfin_api_helper.dart | 10 ++++++++++ pubspec.lock | 6 +++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6ba..dcf0f19c5 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip diff --git a/lib/services/jellyfin_api.chopper.dart b/lib/services/jellyfin_api.chopper.dart index 0d4d2bf4c..636081afa 100644 --- a/lib/services/jellyfin_api.chopper.dart +++ b/lib/services/jellyfin_api.chopper.dart @@ -670,6 +670,5 @@ final class _$JellyfinApi extends JellyfinApi { $request, requestConverter: JsonConverter.requestFactory, ); - return $response.bodyOrThrow; } } diff --git a/lib/services/jellyfin_api_helper.dart b/lib/services/jellyfin_api_helper.dart index 1e463b4d0..ef5d03b8f 100644 --- a/lib/services/jellyfin_api_helper.dart +++ b/lib/services/jellyfin_api_helper.dart @@ -713,6 +713,8 @@ class JellyfinApiHelper { /// Removes the current user from the DB and revokes the token on Jellyfin Future logoutCurrentUser() async { + Response? response; + // We put this in a try-catch loop that basically ignores errors so that the // user can still log out during scenarios like wrong IP, no internet etc. @@ -734,6 +736,14 @@ class JellyfinApiHelper { "Jellyfin logout failed with error $e. Logging out anyway, but be aware that Jellyfin may have not got the signal.", e); } finally { + // If the logout response wasn't successful, warn the user in the logs. + // We continue anyway since this will mostly be for when the client becomes + // unauthorised, which will return 401. + if (response?.isSuccessful == false) { + _jellyfinApiHelperLogger.warning( + "Jellyfin logout returned ${response!.statusCode}. Logging out anyway, but be aware that Jellyfin may still consider this device logged in."); + } + // If we're unauthorised, the logout command will fail but we're already // basically logged out so we shouldn't fail. _finampUserHelper.removeUser(_finampUserHelper.currentUser!.id); diff --git a/pubspec.lock b/pubspec.lock index 46ebd4c74..e78388690 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -791,10 +791,10 @@ packages: dependency: transitive description: name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -1511,7 +1511,7 @@ packages: dependency: transitive description: name: typed_data - sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted version: "1.3.2"