Skip to content

Commit

Permalink
Fixed #940 don't show any shows without a tvdb id
Browse files Browse the repository at this point in the history
Added a link to the netflix movie when you click the label
  • Loading branch information
tidusjar committed Jan 17, 2017
1 parent 809d010 commit e5d7c4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Ombi.UI/Content/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ $(function () {
if (results.result) {
// It's on Netflix
$('#' + id + 'netflixTab')
.html("<span class='label label-success'>Avaialble on Netflix</span>");
.html("<a href='https://www.netflix.com/watch/"+results.netflixId+"' target='_blank'><span class='label label-success'>Avaialble on Netflix</span></a>");
}

});
Expand Down
2 changes: 1 addition & 1 deletion Ombi.UI/Modules/SearchExtensionModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task<Response> Netflix(string title)
return Response.AsJson(new { Result = false });
}

return Response.AsJson(new { Result = true });
return Response.AsJson(new { Result = true, NetflixId = result.ShowId });
}


Expand Down
5 changes: 5 additions & 0 deletions Ombi.UI/Modules/SearchModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ private async Task<Response> ProcessMovies(MovieSearchType searchType, string se
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;
Expand Down Expand Up @@ -345,6 +346,10 @@ private async Task<Response> SearchTvShow(string searchTerm)
var viewTv = new List<SearchTvShowViewModel>();
foreach (var t in apiTv)
{
if (!(t.show.externals?.thetvdb.HasValue) ?? false)
{
continue;
}
var banner = t.show.image?.medium;
if (!string.IsNullOrEmpty(banner))
{
Expand Down

0 comments on commit e5d7c4c

Please sign in to comment.