diff --git a/modules/torrents/client/controllers/uploads.client.controller.js b/modules/torrents/client/controllers/uploads.client.controller.js index 402639ff..6a332005 100644 --- a/modules/torrents/client/controllers/uploads.client.controller.js +++ b/modules/torrents/client/controllers/uploads.client.controller.js @@ -600,9 +600,8 @@ /** * searchFromTMDB - * @param isMovie */ - vm.searchFromTMDB = function (isMovie = true) { + vm.searchFromTMDB = function () { vm.search.status_msg = 'LOAD_SEARCH_RESULT'; vm.search.status = 'loading'; vm.search.searchItems = undefined; @@ -611,7 +610,8 @@ TorrentsService.searchMovie({ language: getStorageLangService.getLang(), - query: vm.search.keys + query: vm.search.keys, + type: vm.selectedType }, function (res) { mtDebug.info(res); diff --git a/modules/torrents/client/views/uploads-torrents.client.view.html b/modules/torrents/client/views/uploads-torrents.client.view.html index b442752d..70db8d27 100644 --- a/modules/torrents/client/views/uploads-torrents.client.view.html +++ b/modules/torrents/client/views/uploads-torrents.client.view.html @@ -111,7 +111,7 @@ placeholder="{{ 'PLACE_HOLDER_SEARCH' | translate}}" autofocus>
-
@@ -134,9 +134,9 @@ @@ -332,8 +332,13 @@
-
+
+
+ +
-
+
-
+
-
+
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 157f78c1..a8f7dff1 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -71,17 +71,31 @@ exports.searchmovie = function (req, res) { mtDebug.debugGreen('------- API: searchMovie --------------------'); mtDebug.debugGreen(req.params); - tmdb.searchMovie({ - language: req.params.language, - query: req.query.query - }, function (err, info) { - if (err) { - res.status(900).send(err); - } else { - res.json(info); - } - }); + var type = req.query.type; + if (type === 'movie') { + tmdb.searchMovie({ + language: req.params.language, + query: req.query.query + }, function (err, info) { + if (err) { + res.status(900).send(err); + } else { + res.json(info); + } + }); + } else if (type === 'tvserial') { + tmdb.searchTv({ + language: req.params.language, + query: req.query.query + }, function (err, info) { + if (err) { + res.status(900).send(err); + } else { + res.json(info); + } + }); + } }; /**