diff --git a/src/Ombi.Api.FanartTv/FanartTvApi.cs b/src/Ombi.Api.FanartTv/FanartTvApi.cs index f7e2c4711..3d84681a5 100644 --- a/src/Ombi.Api.FanartTv/FanartTvApi.cs +++ b/src/Ombi.Api.FanartTv/FanartTvApi.cs @@ -2,6 +2,7 @@ using System.Net.Http; using System.Runtime.CompilerServices; using System.Threading.Tasks; +using Newtonsoft.Json; using Ombi.Api.FanartTv.Models; namespace Ombi.Api.FanartTv @@ -20,8 +21,15 @@ namespace Ombi.Api.FanartTv { var request = new Request($"tv/{tvdbId}", Endpoint, HttpMethod.Get); request.AddHeader("api-key", token); - - return await Api.Request(request); + try + { + return await Api.Request(request); + } + catch (JsonSerializationException) + { + // Usually this is when it's not found + return null; + } } public async Task GetMovieImages(int theMovieDbId, string token) diff --git a/src/Ombi/Controllers/SearchController.cs b/src/Ombi/Controllers/SearchController.cs index 0cbfe0d69..1a5d36b50 100644 --- a/src/Ombi/Controllers/SearchController.cs +++ b/src/Ombi/Controllers/SearchController.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; @@ -134,6 +135,7 @@ namespace Ombi.Controllers [HttpGet("tv/info/{tvdbId}/tree")] public async Task> GetShowInfoTreeNode(int tvdbId) { + if (tvdbId == 0) return new TreeNode(); return await TvEngine.GetShowInformationTreeNode(tvdbId); }