mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Work on the requests page mostly done.
This commit is contained in:
parent
70362b908f
commit
98d143c9b2
17 changed files with 297 additions and 78 deletions
|
@ -25,18 +25,15 @@ $("#tvSearchContent").keypress(function (e) {
|
|||
});
|
||||
|
||||
$(document).on("click", ".dropdownTv", function (e) {
|
||||
var formData = [];
|
||||
|
||||
e.preventDefault();
|
||||
console.log(e.target.id);
|
||||
var $form = $('#form'+e.target.id);
|
||||
var data = $form.serialize();
|
||||
var seasons = $(this).attr("season-select");
|
||||
console.log(data);
|
||||
formData.push(data);
|
||||
if (seasons === "1") {
|
||||
formData.push("latest=true");
|
||||
} else {
|
||||
data.latest = false;
|
||||
data = data + "&latest=true";
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
|
@ -60,7 +57,7 @@ $(document).on("click", ".dropdownTv", function (e) {
|
|||
|
||||
});
|
||||
|
||||
$(document).on("click", ".requesttv", function (e) {
|
||||
$(document).on("click", ".requestMovie", function (e) {
|
||||
e.preventDefault();
|
||||
console.log(e.target.id);
|
||||
var $form = $('#form' + e.target.id);
|
||||
|
@ -114,35 +111,3 @@ function tvSearch() {
|
|||
});
|
||||
};
|
||||
|
||||
function buildMovieContext(result) {
|
||||
var date = new Date(result.releaseDate);
|
||||
var year = date.getFullYear();
|
||||
var context = {
|
||||
posterPath: result.posterPath,
|
||||
id: result.id,
|
||||
title: result.title,
|
||||
overview: result.overview,
|
||||
voteCount: result.voteCount,
|
||||
voteAverage: result.voteAverage,
|
||||
year: year,
|
||||
type : "movie"
|
||||
};
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
function buildTvShowContext(result) {
|
||||
var date = new Date(result.firstAirDate);
|
||||
var year = date.getFullYear();
|
||||
var context = {
|
||||
posterPath: result.posterPath,
|
||||
id: result.id,
|
||||
title: result.name,
|
||||
overview: result.overview,
|
||||
voteCount: result.voteCount,
|
||||
voteAverage: result.voteAverage,
|
||||
year: year,
|
||||
type: "tv"
|
||||
};
|
||||
return context;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue