diff --git a/Ombi.UI/Content/requests.js b/Ombi.UI/Content/requests.js
index 1d2ad987d..4d9a13b5e 100644
--- a/Ombi.UI/Content/requests.js
+++ b/Ombi.UI/Content/requests.js
@@ -95,7 +95,10 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
//if ($tvl.mixItUp('isLoaded')) $tvl.mixItUp('destroy');
//$tvl.mixItUp(mixItUpConfig(activeState)); // init or reinit
}
- if (target === "#MoviesTab") {
+ if (target === "#MoviesTab" || target === "#ActorsTab") {
+ if (target === "#ActorsTab") {
+ actorLoad();
+ }
$('#approveMovies,#deleteMovies').show();
if ($tvl.mixItUp('isLoaded')) {
activeState = $tvl.mixItUp('getState');
@@ -733,6 +736,36 @@ function initLoad() {
}
+
+function actorLoad() {
+ var $ml = $('#actorMovieList');
+ if ($ml.mixItUp('isLoaded')) {
+ activeState = $ml.mixItUp('getState');
+ $ml.mixItUp('destroy');
+ }
+ $ml.html("");
+
+ var url = createBaseUrl(base, '/requests/actor');
+ $.ajax(url).success(function (results) {
+ if (results.length > 0) {
+ results.forEach(function (result) {
+ var context = buildRequestContext(result, "movie");
+ var html = searchTemplate(context);
+ $ml.append(html);
+ });
+
+
+ $('.customTooltip').tooltipster({
+ contentCloning: true
+ });
+ }
+ else {
+ $ml.html(noResultsHtml.format("movie"));
+ }
+ $ml.mixItUp(mixItUpConfig());
+ });
+};
+
function movieLoad() {
var $ml = $('#movieList');
if ($ml.mixItUp('isLoaded')) {
diff --git a/Ombi.UI/Content/search.js b/Ombi.UI/Content/search.js
index fde3077e4..51c4011cd 100644
--- a/Ombi.UI/Content/search.js
+++ b/Ombi.UI/Content/search.js
@@ -63,6 +63,17 @@ $(function () {
});
+ // Type in actor search
+ $("#actorSearchContent").on("input", function () {
+ if (searchTimer) {
+ clearTimeout(searchTimer);
+ }
+ searchTimer = setTimeout(function () {
+ moviesFromActor();
+ }.bind(this), 800);
+
+ });
+
$('#moviesComingSoon').on('click', function (e) {
e.preventDefault();
moviesComingSoon();
@@ -300,7 +311,7 @@ $(function () {
function movieSearch() {
var query = $("#movieSearchContent").val();
var url = createBaseUrl(base, '/search/movie/');
- query ? getMovies(url + query) : resetMovies();
+ query ? getMovies(url + query) : resetMovies("#movieList");
}
function moviesComingSoon() {
@@ -313,6 +324,12 @@ $(function () {
getMovies(url);
}
+ function moviesFromActor() {
+ var query = $("#actorSearchContent").val();
+ var url = createBaseUrl(base, '/search/actor/');
+ query ? getMovies(url + query, "#actorMovieList", "#actorSearchButton") : resetMovies("#actorMovieList");
+ }
+
function popularShows() {
var url = createBaseUrl(base, '/search/tv/popular');
getTvShows(url, true);
@@ -330,30 +347,31 @@ $(function () {
getTvShows(url, true);
}
- function getMovies(url) {
- resetMovies();
-
- $('#movieSearchButton').attr("class", "fa fa-spinner fa-spin");
+ function getMovies(url, target, button) {
+ target = target || "#movieList";
+ button = button || "#movieSearchButton";
+ resetMovies(target);
+ $(button).attr("class", "fa fa-spinner fa-spin");
$.ajax(url).success(function (results) {
if (results.length > 0) {
results.forEach(function (result) {
var context = buildMovieContext(result);
var html = searchTemplate(context);
- $("#movieList").append(html);
+ $(target).append(html);
checkNetflix(context.title, context.id);
});
}
else {
- $("#movieList").html(noResultsHtml);
+ $(target).html(noResultsHtml);
}
- $('#movieSearchButton').attr("class", "fa fa-search");
+ $(button).attr("class", "fa fa-search");
});
};
- function resetMovies() {
- $("#movieList").html("");
+ function resetMovies(target) {
+ $(target).html("");
}
function tvSearch() {
diff --git a/Ombi.UI/Resources/UI.resx b/Ombi.UI/Resources/UI.resx
index d24c5ea1c..7144696a1 100644
--- a/Ombi.UI/Resources/UI.resx
+++ b/Ombi.UI/Resources/UI.resx
@@ -1,76 +1,96 @@