feat(torrent): show torrent H&R tag label in list and detail page

This commit is contained in:
OldHawk
2017-09-07 13:05:41 +08:00
parent 873d29d98e
commit d2edc44283
10 changed files with 63 additions and 3 deletions

View File

@@ -631,6 +631,16 @@ body {
}
}
.label-hnr-info {
color: #eee;
background-color: #333;
&:hover {
cursor: pointer;
color: #f00;
background-color: #000;
}
}
.label-se-info {
color: @mt-base-color;
background-color: #f1f8ff;

View File

@@ -24,6 +24,7 @@
vm.searchTags = [];
vm.searchKey = '';
vm.releaseYear = undefined;
vm.filterHnR = false;
vm.torrentStatus = 'reviewed';
vm.torrentRLevel = 'none';
@@ -185,7 +186,8 @@
torrent_rlevel: vm.torrentRLevel,
torrent_type: vm.selectedType,
torrent_release: vm.releaseYear,
torrent_tags: vm.searchTags
torrent_tags: vm.searchTags,
torrent_hnr: vm.filterHnR
}, function (items) {
if (items.length === 0) {
Notification.error({
@@ -266,6 +268,14 @@
vm.torrentBuildPager();
};
/**
* onHnRClicked
*/
vm.onHnRClicked = function () {
vm.filterHnR = !vm.filterHnR;
vm.torrentBuildPager();
};
/**
* onRLevelClicked
* @param y

View File

@@ -23,6 +23,7 @@
vm.searchTags = [];
vm.searchKey = '';
vm.releaseYear = undefined;
vm.filterHnR = false;
vm.topItems = 6;
vm.torrentType = $state.current.data.torrentType;
@@ -159,7 +160,7 @@
vm.getResourcePageInfo = function (p, callback) {
//if searchKey or searchTags has value, the skip=0
var skip = vm.topItems;
if (vm.searchKey.trim().length > 0 || vm.searchTags.length > 0 || vm.releaseYear) {
if (vm.searchKey.trim().length > 0 || vm.searchTags.length > 0 || vm.releaseYear || vm.filterHnR) {
skip = 0;
}
@@ -170,7 +171,8 @@
torrent_status: 'reviewed',
torrent_type: vm.torrentType,
torrent_release: vm.releaseYear,
torrent_tags: vm.searchTags
torrent_tags: vm.searchTags,
torrent_hnr: vm.filterHnR
}, function (items) {
if (items.length === 0) {
Notification.error({
@@ -251,6 +253,14 @@
vm.torrentBuildPager();
};
/**
* onHnRClicked
*/
vm.onHnRClicked = function () {
vm.filterHnR = !vm.filterHnR;
vm.torrentBuildPager();
};
/**
* getSaleTypeDesc
*/

View File

@@ -185,6 +185,10 @@
</span>
<span class="label label-se-info" ng-if="vm.selectedType == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="vm.onHnRClicked(); $event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"
ng-click="vm.onTagClicked(t); $event.stopPropagation();">

View File

@@ -190,6 +190,10 @@
</span>
<span class="label label-se-info" ng-if="vm.torrentType == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="vm.onHnRClicked(); $event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"
ng-click="vm.onTagClicked(t); $event.stopPropagation();">

View File

@@ -360,6 +360,7 @@
<dd class="h-line">
<div class="list-all-tags">
<span class="label label-release label-warning">{{ vm.torrentLocalInfo.resource_detail_info.release_date}}</span>
<span class="label label-hnr-info" ng-if="vm.torrentLocalInfo.torrent_hnr">H&R</span>
<span ng-repeat="t in vm.torrentLocalInfo.torrent_tags">
<span class="label label-tag">
{{ 'RESOURCESTAGS.' + vm.getTagTitle(t) + '.' + t | translate}}
@@ -589,6 +590,8 @@
</span>
<span class="label label-se-info" ng-if="item.torrent_type == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="$event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent_tags">
<span class="label label-tag" ng-click="$event.stopPropagation();">
{{ 'RESOURCESTAGS.' + vm.getTagTitle(t) + '.' + t | translate}}

View File

@@ -757,6 +757,7 @@ exports.list = function (req, res) {
var rlevel = 'none';
var stype = 'movie';
var newest = false;
var hnr = false;
var release = undefined;
var userid = undefined;
var tagsA = [];
@@ -782,6 +783,9 @@ exports.list = function (req, res) {
if (req.query.torrent_release !== undefined) {
release = req.query.torrent_release;
}
if (req.query.torrent_hnr !== undefined) {
hnr = req.query.torrent_hnr;
}
if (req.query.newest !== undefined) {
newest = (req.query.newest === 'true');
}
@@ -823,6 +827,9 @@ exports.list = function (req, res) {
if (stype !== 'all') {
condition.torrent_type = stype;
}
if (hnr === 'true') {
condition.torrent_hnr = hnr;
}
if (tagsA.length > 0) {
condition.torrent_tags = {$all: tagsA};

View File

@@ -88,6 +88,10 @@
</span>
<span class="label label-se-info" ng-if="item.torrent_type == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="$event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"
ng-click="$event.stopPropagation();">

View File

@@ -88,6 +88,10 @@
</span>
<span class="label label-se-info" ng-if="item.torrent_type == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="$event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"
ng-click="$event.stopPropagation();">

View File

@@ -88,6 +88,10 @@
</span>
<span class="label label-se-info" ng-if="item.torrent_type == 'tvserial'"
ng-click="$event.stopPropagation();">S{{item.torrent_seasons}}E{{item.torrent_episodes}}</span>
<span class="label label-hnr-info" ng-if="item.torrent_hnr"
ng-click="$event.stopPropagation();">H&R</span>
<span ng-repeat="t in item.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"
ng-click="$event.stopPropagation();">