Fully switched the TV shows over to use the other provider.

This commit is contained in:
Jamie Rees 2016-03-03 22:42:58 +00:00
commit 7677831bbc
14 changed files with 231 additions and 30 deletions

View file

@ -85,12 +85,14 @@ function movieSearch() {
var query = $("#movieSearchContent").val();
$.ajax("/search/movie/" + query).success(function (results) {
results.forEach(function (result) {
var context = buildMovieContext(result);
if (results.length > 0) {
results.forEach(function(result) {
var context = buildMovieContext(result);
var html = searchTemplate(context);
$("#movieList").append(html);
});
var html = searchTemplate(context);
$("#movieList").append(html);
});
}
});
};
@ -99,12 +101,13 @@ function tvSearch() {
var query = $("#tvSearchContent").val();
$.ajax("/search/tv/" + query).success(function (results) {
results.data.forEach(function (result) {
var context = buildTvShowContext(result);
var html = searchTemplate(context);
$("#tvList").append(html);
});
if (results.length > 0) {
results.forEach(function(result) {
var context = buildTvShowContext(result);
var html = searchTemplate(context);
$("#tvList").append(html);
});
}
});
};

View file

@ -30,12 +30,10 @@ function buildTvShowContext(result) {
var date = new Date(result.firstAired);
var year = date.getFullYear();
var context = {
posterPath: result.posterPath,
posterPath: result.banner,
id: result.id,
title: result.name,
title: result.seriesName,
overview: result.overview,
voteCount: result.voteCount,
voteAverage: result.voteAverage,
year: year,
type: "tv"
};