fix(vip): Reorganize vip torrents show/hide

show in user status uploaded torrents list
show in uploaded list at admin user page
show in all newest torrents list at admin manage page
This commit is contained in:
OldHawk
2017-12-07 11:45:58 +08:00
parent 99a5e44d12
commit c93ff903bf
8 changed files with 37 additions and 14 deletions

View File

@@ -162,6 +162,7 @@
vm.moviesInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'movie',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -185,6 +186,7 @@
vm.moviesInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'movie',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -209,6 +211,7 @@
vm.tvsInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'tvserial',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -228,6 +231,7 @@
vm.tvsInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'tvserial',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -248,6 +252,7 @@
vm.musicInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'music',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -267,6 +272,7 @@
vm.musicInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'music',
torrent_vip: false,
newest: true,
limit: 13
}, function (items) {
@@ -287,6 +293,7 @@
vm.sportsInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'sports',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -306,6 +313,7 @@
vm.sportsInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'sports',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -326,6 +334,7 @@
vm.varietyInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'variety',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -345,6 +354,7 @@
vm.varietyInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'variety',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -365,6 +375,7 @@
vm.pictureInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'picture',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -384,6 +395,7 @@
vm.pictureInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'picture',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -404,6 +416,7 @@
vm.gameInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'game',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -423,6 +436,7 @@
vm.gameInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'game',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -443,6 +457,7 @@
vm.softwareInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'software',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -462,6 +477,7 @@
vm.softwareInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'software',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {
@@ -482,6 +498,7 @@
vm.ebookInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'ebook',
torrent_vip: false,
limit: 9
}, function (items) {
if (items.rows.length > 0) {
@@ -501,6 +518,7 @@
vm.ebookInfo = TorrentsService.get({
torrent_status: 'reviewed',
torrent_type: 'ebook',
torrent_vip: false,
newest: true,
limit: 14
}, function (items) {

View File

@@ -207,7 +207,7 @@
torrent_release: vm.releaseYear,
torrent_tags: vm.searchTags,
torrent_hnr: vm.filterHnR,
torrent_vip: vm.filterVIP,
torrent_vip: vm.filterVIP ? vm.filterVIP : undefined,
torrent_sale: vm.filterSale
}, function (items) {
if (items.length === 0) {

View File

@@ -82,7 +82,8 @@
TorrentsService.get({
limit: vm.topItems,
torrent_status: 'reviewed',
torrent_type: vm.torrentType
torrent_type: vm.torrentType,
torrent_vip: false
}, function (items) {
mtDebug.info(items);
vm.listTopInfo = items.rows;
@@ -295,6 +296,7 @@
keys: vm.searchKey.trim(),
torrent_status: 'reviewed',
torrent_type: vm.torrentType,
torrent_vip: false,
torrent_release: vm.releaseYear,
torrent_tags: vm.searchTags,
torrent_hnr: vm.filterHnR,

View File

@@ -189,7 +189,7 @@
<h5 class="media-heading">
<a ui-sref="torrents.view({torrentId: item._id})">{{vm.TGI.getTorrentDoubleTitle(item)}}</a>
<span class="upload-by" ng-show="item.user.displayName"> (By:
<span user-info="item.user" info-name></span> )</span>
<span user-info="item.user" info-name></span> <span maker-info="item.maker"></span>)</span>
</h5>
<div class="list-all-genres">

View File

@@ -233,11 +233,14 @@
{{item.torrent_sale_status}} {{item.torrent_sale_expires | unlife}}
</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 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-vip-info" ng-if="item.torrent_vip" ng-class="{'used': vm.filterVIP}"
ng-click="vm.onVIPClicked(); $event.stopPropagation();">VIP</span>
<span ng-repeat="t in item.torrent_tags">
<span class="label label-tag" ng-class="{'used': vm.searchTags.indexOf(t) !== -1}"

View File

@@ -1294,7 +1294,7 @@ exports.list = function (req, res) {
var newest = false;
var hnr = false;
var sale = false;
var vip = false;
var vip = undefined;
var release = undefined;
var userid = undefined;
var maker = undefined;
@@ -1386,10 +1386,12 @@ exports.list = function (req, res) {
$ne: 'U1/D1'
};
}
if (vip === true) {
condition.torrent_vip = true;
} else {
condition.torrent_vip = false;
if (vip !== undefined) {
if (vip === true) {
condition.torrent_vip = true;
} else {
condition.torrent_vip = false;
}
}
if (tagsA.length > 0) {

View File

@@ -69,8 +69,7 @@
TorrentsService.get({
userid: $state.params.userId,
torrent_type: 'all',
torrent_status: 'all',
torrent_vip: false
torrent_status: 'all'
}, function (items) {
vm.userUploadedList = items.rows;
vm.buildPager();

View File

@@ -69,8 +69,7 @@
TorrentsService.get({
userid: vm.user._id,
torrent_type: 'all',
torrent_status: 'all',
torrent_vip: false
torrent_status: 'all'
}, function (items) {
vm.uploadedList = items.rows;
mtDebug.info(items);