mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
#55 first attempt at "suggestions" starting with "Comming Soon" and "In Theaters"
This commit is contained in:
parent
1a2ec7ac7f
commit
0b822615bd
5 changed files with 75 additions and 7 deletions
|
@ -22,6 +22,16 @@ $("#movieSearchContent").on("input", function () {
|
|||
|
||||
});
|
||||
|
||||
$('#moviesComingSoon').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
moviesComingSoon();
|
||||
});
|
||||
|
||||
$('#moviesInTheaters').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
moviesInTheaters();
|
||||
});
|
||||
|
||||
// Type in TV search
|
||||
$("#tvSearchContent").on("input", function () {
|
||||
if (tvimer) {
|
||||
|
@ -114,10 +124,23 @@ function sendRequestAjax(data, type, url, buttonId) {
|
|||
}
|
||||
|
||||
function movieSearch() {
|
||||
$("#movieList").html("");
|
||||
var query = $("#movieSearchContent").val();
|
||||
getMovies("/search/movie/" + query);
|
||||
}
|
||||
|
||||
$.ajax("/search/movie/" + query).success(function (results) {
|
||||
function moviesComingSoon() {
|
||||
getMovies("/search/movie/upcoming");
|
||||
}
|
||||
|
||||
function moviesInTheaters() {
|
||||
getMovies("/search/movie/playing")
|
||||
}
|
||||
|
||||
function getMovies(url) {
|
||||
$("#movieList").html("");
|
||||
|
||||
|
||||
$.ajax(url).success(function (results) {
|
||||
if (results.length > 0) {
|
||||
results.forEach(function(result) {
|
||||
var context = buildMovieContext(result);
|
||||
|
@ -133,11 +156,15 @@ function movieSearch() {
|
|||
});
|
||||
};
|
||||
|
||||
function tvSearch() {
|
||||
$("#tvList").html("");
|
||||
function tvShowSearch() {
|
||||
var query = $("#tvSearchContent").val();
|
||||
getTvShows("/search/tv/" + query);
|
||||
}
|
||||
|
||||
$.ajax("/search/tv/" + query).success(function (results) {
|
||||
function getTvShows(url) {
|
||||
$("#tvList").html("");
|
||||
|
||||
$.ajax(url).success(function (results) {
|
||||
if (results.length > 0) {
|
||||
results.forEach(function(result) {
|
||||
var context = buildTvShowContext(result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue