From fe711b6783d781f1474c0476b7d767f416d52f77 Mon Sep 17 00:00:00 2001 From: Victor Usoltsev Date: Tue, 24 Nov 2020 22:06:41 +1300 Subject: [PATCH] Ignores Trakt exceptions when retrieving optional tv show information. --- src/Ombi.Api.Trakt/TraktApi.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Ombi.Api.Trakt/TraktApi.cs b/src/Ombi.Api.Trakt/TraktApi.cs index c3faa5115..8bdabebe5 100644 --- a/src/Ombi.Api.Trakt/TraktApi.cs +++ b/src/Ombi.Api.Trakt/TraktApi.cs @@ -1,4 +1,5 @@  +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -48,7 +49,18 @@ namespace Ombi.Api.Trakt public async Task GetTvExtendedInfo(string imdbId) { - return await Client.Shows.GetShowAsync(imdbId, TraktExtendedOption.Full); + try + { + return await Client.Shows.GetShowAsync(imdbId, TraktExtendedOption.Full); + } + catch (Exception e) + { + // Ignore the exception since the information returned from this API is optional. + Console.WriteLine($"Failed to retrieve extended tv information from Trakt. IMDbId: '{imdbId}'."); + Console.WriteLine(e); + } + + return null; } } }