mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-06 12:11:02 +01:00
feat(torrents): auto search tvserial from tmdb when uploading
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
placeholder="{{ 'PLACE_HOLDER_SEARCH' | translate}}" autofocus>
|
||||
|
||||
<div class="input-group-btn">
|
||||
<button id="btnSearchFromTMDB" class="btn btn-primary" ng-click="vm.searchFromTMDB(true)"
|
||||
<button id="btnSearchFromTMDB" class="btn btn-primary" ng-click="vm.searchFromTMDB()"
|
||||
ng-disabled="!vm.search.keys">{{ 'BTN_SEARCH' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
@@ -134,9 +134,9 @@
|
||||
<label ng-dblclick="vm.onSelectResult()">
|
||||
<input type="radio" name="n_{{r.id}}" id="i_{{r.id}}" value="{{r.id}}"
|
||||
ng-model="vm.search.sid">
|
||||
{{r.title}}
|
||||
{{r.title || r.name}}
|
||||
<div>
|
||||
<small class="text-muted">{{r.original_title}} - {{r.release_date}}</small>
|
||||
<small class="text-muted">{{r.original_title || r.original_name}} - {{r.release_date || r.first_air_date}}</small>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
@@ -332,8 +332,13 @@
|
||||
<div class="row margin-bottom-40">
|
||||
<div class="col-md-12 col-sm-12 col-xs-12">
|
||||
<legend class="small-legend" translate="ENTER_TMDB_ID"></legend>
|
||||
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-6">
|
||||
<div class="col-sm-7 col-md-6 col-lg-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" ng-click="vm.beginSearchFromTMDB($event)">
|
||||
{{ 'SEARCH_FROM_TMDB' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<input type="number" class="form-control" ng-model="vm.tmdb_id"
|
||||
id="tmdbid"
|
||||
ng-change="vm.tmdb_info_ok = undefined"
|
||||
@@ -349,13 +354,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="vm.tmdb_info_ok == true" class="col-lg-9 col-md-8 col-sm-7 col-xs-6" style="margin-top: 7px">
|
||||
<div ng-show="vm.tmdb_info_ok == true" class="col-sm-5 col-md-6 col-lg-7" style="margin-top: 7px">
|
||||
<label class="text-success control-label" translate="TMDB_ID_OK"></label>
|
||||
</div>
|
||||
<div ng-show="vm.tmdb_info_ok == false" class="col-lg-9 col-md-8 col-sm-7 col-xs-6" style="margin-top: 7px">
|
||||
<div ng-show="vm.tmdb_info_ok == false" class="col-sm-5 col-md-6 col-lg-7" style="margin-top: 7px">
|
||||
<label class="text-danger control-label" translate="TMDB_ID_ERROR"></label>
|
||||
</div>
|
||||
<div ng-show="vm.tmdb_isloading" class="col-lg-9 col-md-8 col-sm-7 col-xs-6" style="margin-top: 7px">
|
||||
<div ng-show="vm.tmdb_isloading" class="col-sm-5 col-md-6 col-lg-7" style="margin-top: 7px">
|
||||
<label class="text-danger control-label" translate="TMDB_IS_LOADING"></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user