Skip to content

Commit

Permalink
fix(torrents): fixed torrent tags filter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
taobataoma committed May 21, 2018
1 parent 621f168 commit e683424
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
skip: (p - 1) * vm.itemsPerPage,
limit: vm.itemsPerPage,
sort: vm.sort,
torrent_type: (vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_type: (vm.filterType && vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_status: 'reviewed',
maker: vm.maker._id,
keys: vm.searchKey,
Expand Down
4 changes: 2 additions & 2 deletions modules/about/client/views/maker-view.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ <h3 class="panel-title">-={{vm.maker.name}}=- &emsp;&emsp; {{'TAGS_SEARCH' | tra
</div>
<div class="panel-body">
<div class="row filter-tags text-center"
ng-if="vm.filterType!='aggregate' || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
ng-if="(vm.filterType && vm.filterType!='aggregate') || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
<div class="col-md-6 col-md-offset-3">
<span class="filter-tag-item label-tag" ng-if="vm.filterType!='aggregate'">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<span class="filter-tag-item label-tag" ng-if="vm.filterType && vm.filterType!='aggregate'">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<i class="fa fa-times-circle-o"
ng-click="vm.onTorrentTypeClicked(vm.filterType);">
</i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
} else {
vm.filterType = vm.torrentType;
}
console.log('vm.filterType = ' + vm.filterType);
});

/**
Expand Down Expand Up @@ -311,14 +312,17 @@
//if searchKey or searchTags has value, the skip=0
var skip = 0;

console.log(vm.filterType);
console.log(vm.torrentType);

TorrentsService.get({
skip: (p - 1) * vm.torrentItemsPerPage + skip,
limit: vm.torrentItemsPerPage,
sort: vm.sort,
keys: vm.searchKey.trim(),
torrent_status: 'reviewed',
torrent_rlevel: vm.torrentRLevel,
torrent_type: (vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_type: (vm.filterType && vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_vip: false,
torrent_release: vm.releaseYear,
torrent_tags: vm.searchTags,
Expand Down Expand Up @@ -350,7 +354,7 @@
vm.rssUrl += '?language=' + vm.lang;
vm.rssUrl += '&limit=' + vm.rssConfig.pageItemsNumber;
vm.rssUrl += vm.searchKey.trim() ? '&keys=' + vm.searchKey.trim() : '';
vm.rssUrl += '&torrent_type=' + ((vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType));
vm.rssUrl += '&torrent_type=' + ((vm.filterType && vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType));
vm.rssUrl += vm.releaseYear ? '&torrent_release=' + vm.releaseYear : '';
vm.rssUrl += vm.searchTags.length ? '&torrent_tags=' + vm.searchTags : '';
vm.rssUrl += '&torrent_hnr=' + vm.filterHnR;
Expand Down
4 changes: 2 additions & 2 deletions modules/torrents/client/views/list-torrents.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ <h3 class="panel-title">{{'TAGS_SEARCH' | translate}} - {{'MENU_TORRENTS_SUB.' +
</div>
<div class="panel-body">
<div class="row filter-tags text-center"
ng-if="(vm.filterType!='aggregate' && vm.filterType!=vm.torrentType) || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
ng-if="(vm.filterType && vm.filterType!='aggregate' && vm.filterType!=vm.torrentType) || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
<div class="col-md-6 col-md-offset-3">
<span class="filter-tag-item label-tag" ng-if="vm.filterType!='aggregate' && vm.filterType!=vm.torrentType">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<span class="filter-tag-item label-tag" ng-if="vm.filterType && vm.filterType!='aggregate' && vm.filterType!=vm.torrentType">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<i class="fa fa-times-circle-o"
ng-click="vm.onTorrentTypeClicked(vm.filterType);">
</i>
Expand Down
4 changes: 2 additions & 2 deletions modules/vip/client/controllers/vip.client.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
skip: (p - 1) * vm.itemsPerPage,
limit: vm.itemsPerPage,
sort: vm.sort,
torrent_type: (vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_type: (vm.filterType && vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType),
torrent_status: 'reviewed',
torrent_vip: true,
keys: vm.searchKey.trim(),
Expand Down Expand Up @@ -305,7 +305,7 @@
vm.rssUrl += '?language=' + localStorageService.get('storage_user_lang');
vm.rssUrl += '&limit=' + vm.rssConfig.pageItemsNumber;
vm.rssUrl += vm.searchKey.trim() ? '&keys=' + vm.searchKey.trim() : '';
vm.rssUrl += '&torrent_type=' + ((vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType));
vm.rssUrl += '&torrent_type=' + ((vm.filterType && vm.filterType !== 'aggregate') ? vm.filterType : (vm.torrentType === 'aggregate' ? 'all' : vm.torrentType));
vm.rssUrl += vm.releaseYear ? '&torrent_release=' + vm.releaseYear : '';
vm.rssUrl += vm.searchTags.length ? '&torrent_tags=' + vm.searchTags : '';
vm.rssUrl += '&torrent_hnr=' + vm.filterHnR;
Expand Down
4 changes: 2 additions & 2 deletions modules/vip/client/views/vip.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ <h3 class="panel-title">{{'VIP.TORRENTS_LIST' | translate}} - {{'TAGS_SEARCH' |
</div>
<div class="panel-body">
<div class="row filter-tags text-center"
ng-if="vm.filterType!='aggregate' || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
ng-if="(vm.filterType && vm.filterType!='aggregate') || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
<div class="col-md-6 col-md-offset-3">
<span class="filter-tag-item label-tag" ng-if="vm.filterType!='aggregate'">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<span class="filter-tag-item label-tag" ng-if="vm.filterType && vm.filterType!='aggregate'">{{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}
<i class="fa fa-times-circle-o"
ng-click="vm.onTorrentTypeClicked(vm.filterType);">
</i>
Expand Down

0 comments on commit e683424

Please sign in to comment.