From 2f31bb1f5f69488b25424c22b358cd7555def65d Mon Sep 17 00:00:00 2001 From: Hans Lehnert Date: Mon, 2 Sep 2024 01:23:48 -0700 Subject: [PATCH] Address comments --- .../Providers/AniList/AniListAnimeImageProvider.cs | 2 +- .../Providers/AniList/AniListPersonProvider.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.AniList/Providers/AniList/AniListAnimeImageProvider.cs b/Jellyfin.Plugin.AniList/Providers/AniList/AniListAnimeImageProvider.cs index 00ca0c5..3b84f00 100644 --- a/Jellyfin.Plugin.AniList/Providers/AniList/AniListAnimeImageProvider.cs +++ b/Jellyfin.Plugin.AniList/Providers/AniList/AniListAnimeImageProvider.cs @@ -44,7 +44,7 @@ public async Task> GetImages(string aid, Cancellati if (!string.IsNullOrEmpty(aid)) { - Media media = await _aniListApi.GetAnime(aid, cancellationToken); + Media media = await _aniListApi.GetAnime(aid, cancellationToken).ConfigureAwait(false); if (media != null) { if (media.GetImageUrl() != null) diff --git a/Jellyfin.Plugin.AniList/Providers/AniList/AniListPersonProvider.cs b/Jellyfin.Plugin.AniList/Providers/AniList/AniListPersonProvider.cs index fdc928c..199e417 100644 --- a/Jellyfin.Plugin.AniList/Providers/AniList/AniListPersonProvider.cs +++ b/Jellyfin.Plugin.AniList/Providers/AniList/AniListPersonProvider.cs @@ -33,7 +33,12 @@ public async Task> GetMetadata(PersonLookupInfo info, Can { var result = new MetadataResult(); - int anilistId = int.Parse(info.GetProviderId(ProviderNames.AniList)); + if (!info.TryGetProviderId(ProviderNames.AniList, out string stringId) + || !int.TryParse(stringId, out int anilistId)) + { + return result; + } + Staff staff = await _aniListApi.GetStaff(anilistId, cancellationToken).ConfigureAwait(false); if (staff == null)