diff --git a/src/Ombi.Core/Engine/TvSearchEngine.cs b/src/Ombi.Core/Engine/TvSearchEngine.cs index 34b49289c..4eee6a74f 100644 --- a/src/Ombi.Core/Engine/TvSearchEngine.cs +++ b/src/Ombi.Core/Engine/TvSearchEngine.cs @@ -65,7 +65,17 @@ namespace Ombi.Core.Engine public async Task GetShowInformation(int tvdbid) { var show = await TvMazeApi.ShowLookupByTheTvDbId(tvdbid); + if (show == null) + { + // We don't have enough information + return null; + } var episodes = await TvMazeApi.EpisodeLookup(show.id); + if (episodes == null || !episodes.Any()) + { + // We don't have enough information + return null; + } var mapped = Mapper.Map(show); diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.ts b/src/Ombi/ClientApp/app/search/tvsearch.component.ts index 2c4e26a8a..683e81137 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.ts +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.ts @@ -131,7 +131,14 @@ export class TvSearchComponent implements OnInit, OnDestroy { this.searchService.getShowInformationTreeNode(val.data.id) .takeUntil(this.subscriptions) .subscribe(x => { - this.updateItem(val, x); + if (x.data) { + this.updateItem(val, x); + } else { + const index = this.tvResults.indexOf(val, 0); + if (index > -1) { + this.tvResults.splice(index, 1); + } + } }); }); }