From e6834243c22dbd810529c0ad9502d4dcad980cec Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 21 May 2018 23:11:56 +0800 Subject: [PATCH] fix(torrents): fixed torrent tags filter issue --- .../about/client/controllers/about.client.controller.js | 2 +- modules/about/client/views/maker-view.client.view.html | 4 ++-- .../client/controllers/torrents.client.controller.js | 8 ++++++-- .../torrents/client/views/list-torrents.client.view.html | 4 ++-- modules/vip/client/controllers/vip.client.controller.js | 4 ++-- modules/vip/client/views/vip.client.view.html | 4 ++-- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/about/client/controllers/about.client.controller.js b/modules/about/client/controllers/about.client.controller.js index 7528754c..8ac7ca33 100644 --- a/modules/about/client/controllers/about.client.controller.js +++ b/modules/about/client/controllers/about.client.controller.js @@ -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, diff --git a/modules/about/client/views/maker-view.client.view.html b/modules/about/client/views/maker-view.client.view.html index 27f0997d..a6a1e212 100644 --- a/modules/about/client/views/maker-view.client.view.html +++ b/modules/about/client/views/maker-view.client.view.html @@ -119,9 +119,9 @@
+ ng-if="(vm.filterType && vm.filterType!='aggregate') || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
- {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index f72e9c01..4f30c5fc 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -48,6 +48,7 @@ } else { vm.filterType = vm.torrentType; } + console.log('vm.filterType = ' + vm.filterType); }); /** @@ -311,6 +312,9 @@ //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, @@ -318,7 +322,7 @@ 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, @@ -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; diff --git a/modules/torrents/client/views/list-torrents.client.view.html b/modules/torrents/client/views/list-torrents.client.view.html index de0714e7..5416b2ea 100644 --- a/modules/torrents/client/views/list-torrents.client.view.html +++ b/modules/torrents/client/views/list-torrents.client.view.html @@ -72,9 +72,9 @@
+ 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">
- {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} diff --git a/modules/vip/client/controllers/vip.client.controller.js b/modules/vip/client/controllers/vip.client.controller.js index df05b5a4..3d176525 100644 --- a/modules/vip/client/controllers/vip.client.controller.js +++ b/modules/vip/client/controllers/vip.client.controller.js @@ -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(), @@ -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; diff --git a/modules/vip/client/views/vip.client.view.html b/modules/vip/client/views/vip.client.view.html index 5fa66144..c0d3dc6e 100644 --- a/modules/vip/client/views/vip.client.view.html +++ b/modules/vip/client/views/vip.client.view.html @@ -37,9 +37,9 @@
+ ng-if="(vm.filterType && vm.filterType!='aggregate') || vm.releaseYear || vm.torrentRLevel != 'level0' || vm.filterSale || vm.filterHnR || vm.filterTop || vm.filterUnique || vm.searchTags.length>0">
- {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}} + {{'TORRENT_TYPE_LABEL.' + vm.filterType.toUpperCase() | translate}}