Improved the backend in regards to searching

This commit is contained in:
tidusjar 2019-05-18 23:38:34 +01:00
parent 4fb965e782
commit e5b74d32d0
5 changed files with 16 additions and 8 deletions

View file

@ -53,6 +53,10 @@ namespace Ombi.Core.Engine.V2
{
var tvdbshow = await Cache.GetOrAdd(nameof(GetShowInformation) + tvdbid,
async () => await TvMazeApi.ShowLookupByTheTvDbId(tvdbid), DateTime.Now.AddHours(12));
if (tvdbshow == null)
{
return null;
}
var show = await Cache.GetOrAdd("GetTvFullInformation" + tvdbshow.id,
async () => await TvMazeApi.GetTvFullInformation(tvdbshow.id), DateTime.Now.AddHours(12));
if (show == null)
@ -148,9 +152,9 @@ namespace Ombi.Core.Engine.V2
return model;
}
model.Trailer = result.Trailer.AbsoluteUri;
model.Trailer = result.Trailer?.AbsoluteUri ?? string.Empty;
model.Certification = result.Certification;
model.Homepage = result.Homepage.AbsoluteUri;
model.Homepage = result.Homepage?.AbsoluteUri ?? string.Empty;
return model;
}