From 9df9c64e349c5213e7720ebdd4ff0f53b0106e75 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 9 May 2018 18:25:59 +0800 Subject: [PATCH] fix(torrents): fixed torrents tags filter issue --- .../controllers/torrents.client.controller.js | 20 +++++++++++++++++++ .../views/list-torrents.client.view.html | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index 9f6eccd0..148cf0ee 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -426,6 +426,26 @@ vm.torrentBuildPager(); }; + /** + * tagsFilter + * @param item + * @returns {boolean} + */ + vm.tagsFilter = function (item) { + var res = false; + if (vm.torrentType === 'aggregate') { + angular.forEach(vm.torrentTypeConfig.value, function (t) { + if (t.enable && item.cats.includes(t.value)) + res = true; + }); + } else { + if (item.cats.includes(vm.torrentType)) + res = true; + } + + return res; + }; + /** * onMoreTagsClicked */ diff --git a/modules/torrents/client/views/list-torrents.client.view.html b/modules/torrents/client/views/list-torrents.client.view.html index 64058be1..9e00f2c1 100644 --- a/modules/torrents/client/views/list-torrents.client.view.html +++ b/modules/torrents/client/views/list-torrents.client.view.html @@ -154,7 +154,7 @@