mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
Fixed the UI erroring out, also dont show tv with no externals
This commit is contained in:
parent
12b5e19680
commit
1e1ec436af
2 changed files with 13 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Ombi.Api.FanartTv.Models;
|
using Ombi.Api.FanartTv.Models;
|
||||||
|
|
||||||
namespace Ombi.Api.FanartTv
|
namespace Ombi.Api.FanartTv
|
||||||
|
@ -20,9 +21,16 @@ namespace Ombi.Api.FanartTv
|
||||||
{
|
{
|
||||||
var request = new Request($"tv/{tvdbId}", Endpoint, HttpMethod.Get);
|
var request = new Request($"tv/{tvdbId}", Endpoint, HttpMethod.Get);
|
||||||
request.AddHeader("api-key", token);
|
request.AddHeader("api-key", token);
|
||||||
|
try
|
||||||
|
{
|
||||||
return await Api.Request<TvResult>(request);
|
return await Api.Request<TvResult>(request);
|
||||||
}
|
}
|
||||||
|
catch (JsonSerializationException)
|
||||||
|
{
|
||||||
|
// Usually this is when it's not found
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<MovieResult> GetMovieImages(int theMovieDbId, string token)
|
public async Task<MovieResult> GetMovieImages(int theMovieDbId, string token)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
@ -134,6 +135,7 @@ namespace Ombi.Controllers
|
||||||
[HttpGet("tv/info/{tvdbId}/tree")]
|
[HttpGet("tv/info/{tvdbId}/tree")]
|
||||||
public async Task<TreeNode<SearchTvShowViewModel>> GetShowInfoTreeNode(int tvdbId)
|
public async Task<TreeNode<SearchTvShowViewModel>> GetShowInfoTreeNode(int tvdbId)
|
||||||
{
|
{
|
||||||
|
if (tvdbId == 0) return new TreeNode<SearchTvShowViewModel>();
|
||||||
return await TvEngine.GetShowInformationTreeNode(tvdbId);
|
return await TvEngine.GetShowInformationTreeNode(tvdbId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue