From e5d7c4c3ec36959ead54e1ec8b77f7eaf4e2ed42 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 17 Jan 2017 21:28:11 +0000 Subject: [PATCH] Fixed #940 don't show any shows without a tvdb id Added a link to the netflix movie when you click the label --- Ombi.UI/Content/search.js | 2 +- Ombi.UI/Modules/SearchExtensionModule.cs | 2 +- Ombi.UI/Modules/SearchModule.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Ombi.UI/Content/search.js b/Ombi.UI/Content/search.js index 8b71215fb..8b9c10109 100644 --- a/Ombi.UI/Content/search.js +++ b/Ombi.UI/Content/search.js @@ -355,7 +355,7 @@ $(function () { if (results.result) { // It's on Netflix $('#' + id + 'netflixTab') - .html("Avaialble on Netflix"); + .html("Avaialble on Netflix"); } }); diff --git a/Ombi.UI/Modules/SearchExtensionModule.cs b/Ombi.UI/Modules/SearchExtensionModule.cs index 05fdfe003..4c0ee4a6f 100644 --- a/Ombi.UI/Modules/SearchExtensionModule.cs +++ b/Ombi.UI/Modules/SearchExtensionModule.cs @@ -54,7 +54,7 @@ namespace Ombi.UI.Modules return Response.AsJson(new { Result = false }); } - return Response.AsJson(new { Result = true }); + return Response.AsJson(new { Result = true, NetflixId = result.ShowId }); } diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index 8759d0325..30acdf68a 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -246,6 +246,7 @@ namespace Ombi.UI.Modules if (counter <= 5) // Let's only do it for the first 5 items { var movieInfoTask = await MovieApi.GetMovieInformation(movie.Id).ConfigureAwait(false); + // TODO needs to be careful about this, it's adding extra time to search... // https://www.themoviedb.org/talk/5807f4cdc3a36812160041f2 imdbId = movieInfoTask?.ImdbId; @@ -345,6 +346,10 @@ namespace Ombi.UI.Modules var viewTv = new List(); foreach (var t in apiTv) { + if (!(t.show.externals?.thetvdb.HasValue) ?? false) + { + continue; + } var banner = t.show.image?.medium; if (!string.IsNullOrEmpty(banner)) {