mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-06 12:11:02 +01:00
fix(torrents): remove redundant string code
This commit is contained in:
@@ -69,13 +69,12 @@
|
||||
* orderByVote
|
||||
*/
|
||||
vm.orderByVote = function () {
|
||||
vm.sortSLF = undefined;
|
||||
|
||||
if (vm.sortVote === undefined) {
|
||||
vm.sortVote = '-';
|
||||
vm.sort = '-resource_detail_info.vote_average';
|
||||
vm.sort = {'resource_detail_info.vote_average': -1};
|
||||
} else if (vm.sortVote === '-') {
|
||||
vm.sortVote = '+';
|
||||
vm.sort = 'resource_detail_info.vote_average';
|
||||
} else if (vm.sortVote === '+') {
|
||||
vm.sortVote = undefined;
|
||||
vm.sort = undefined;
|
||||
}
|
||||
@@ -87,33 +86,19 @@
|
||||
* orderBySLF
|
||||
*/
|
||||
vm.orderBySLF = function () {
|
||||
vm.sortVote = undefined;
|
||||
|
||||
if (vm.sortSLF === undefined) {
|
||||
vm.sortSLF = '-S';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_S');
|
||||
vm.sort = '-torrent_seeds';
|
||||
vm.sort = {torrent_seeds: -1};
|
||||
} else if (vm.sortSLF === '-S') {
|
||||
vm.sortSLF = '+S';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_S');
|
||||
vm.sort = 'torrent_seeds';
|
||||
} else if (vm.sortSLF === '+S') {
|
||||
vm.sortSLF = '-L';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_L');
|
||||
vm.sort = '-torrent_leechers';
|
||||
vm.sort = {torrent_leechers: -1};
|
||||
} else if (vm.sortSLF === '-L') {
|
||||
vm.sortSLF = '+L';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_L');
|
||||
vm.sort = 'torrent_leechers';
|
||||
} else if (vm.sortSLF === '+L') {
|
||||
vm.sortSLF = '-F';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_F');
|
||||
vm.sort = '-torrent_finished';
|
||||
vm.sort = {torrent_finished: -1};
|
||||
} else if (vm.sortSLF === '-F') {
|
||||
vm.sortSLF = '+F';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_F');
|
||||
vm.sort = 'torrent_finished';
|
||||
} else if (vm.sortSLF === '+F') {
|
||||
vm.sortSLF = undefined;
|
||||
vm.sortSLFString = undefined;
|
||||
vm.sort = undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,6 @@
|
||||
ng-click="vm.orderByVote();"
|
||||
uib-tooltip="{{ 'TABLE_FIELDS.TITLE_VOTES' | translate}}">{{ 'TABLE_FIELDS.VOTES' | translate}}</a>
|
||||
<i class="fa fa-caret-down text-info" ng-if="vm.sortVote == '-'"></i>
|
||||
<i class="fa fa-caret-up text-info" ng-if="vm.sortVote == '+'"></i>
|
||||
</th>
|
||||
<th class="text-center">{{ 'TABLE_FIELDS.LIFETIME' | translate}}</th>
|
||||
<th class="text-center">{{ 'TABLE_FIELDS.SIZE' | translate}}</th>
|
||||
|
||||
@@ -61,13 +61,12 @@
|
||||
* orderByVote
|
||||
*/
|
||||
vm.orderByVote = function () {
|
||||
vm.sortSLF = undefined;
|
||||
|
||||
if (vm.sortVote === undefined) {
|
||||
vm.sortVote = '-';
|
||||
vm.sort = '-resource_detail_info.vote_average';
|
||||
vm.sort = {'resource_detail_info.vote_average': -1};
|
||||
} else if (vm.sortVote === '-') {
|
||||
vm.sortVote = '+';
|
||||
vm.sort = 'resource_detail_info.vote_average';
|
||||
} else if (vm.sortVote === '+') {
|
||||
vm.sortVote = undefined;
|
||||
vm.sort = undefined;
|
||||
}
|
||||
@@ -79,33 +78,19 @@
|
||||
* orderBySLF
|
||||
*/
|
||||
vm.orderBySLF = function () {
|
||||
vm.sortVote = undefined;
|
||||
|
||||
if (vm.sortSLF === undefined) {
|
||||
vm.sortSLF = '-S';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_S');
|
||||
vm.sort = '-torrent_seeds';
|
||||
vm.sort = {torrent_seeds: -1};
|
||||
} else if (vm.sortSLF === '-S') {
|
||||
vm.sortSLF = '+S';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_S');
|
||||
vm.sort = 'torrent_seeds';
|
||||
} else if (vm.sortSLF === '+S') {
|
||||
vm.sortSLF = '-L';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_L');
|
||||
vm.sort = '-torrent_leechers';
|
||||
vm.sort = {torrent_leechers: -1};
|
||||
} else if (vm.sortSLF === '-L') {
|
||||
vm.sortSLF = '+L';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_L');
|
||||
vm.sort = 'torrent_leechers';
|
||||
} else if (vm.sortSLF === '+L') {
|
||||
vm.sortSLF = '-F';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_F');
|
||||
vm.sort = '-torrent_finished';
|
||||
vm.sort = {torrent_finished: -1};
|
||||
} else if (vm.sortSLF === '-F') {
|
||||
vm.sortSLF = '+F';
|
||||
vm.sortSLFString = $translate.instant('TABLE_FIELDS.SORT_F');
|
||||
vm.sort = 'torrent_finished';
|
||||
} else if (vm.sortSLF === '+F') {
|
||||
vm.sortSLF = undefined;
|
||||
vm.sortSLFString = undefined;
|
||||
vm.sort = undefined;
|
||||
}
|
||||
|
||||
@@ -165,6 +150,15 @@
|
||||
* @param callback
|
||||
*/
|
||||
vm.getVIPTorrents = function (p, callback) {
|
||||
console.log({
|
||||
skip: (p - 1) * vm.itemsPerPage,
|
||||
limit: vm.itemsPerPage,
|
||||
sort: vm.sort,
|
||||
torrent_type: vm.vipTorrentType,
|
||||
torrent_status: 'reviewed',
|
||||
torrent_vip: true,
|
||||
keys: vm.search
|
||||
});
|
||||
TorrentsService.get({
|
||||
skip: (p - 1) * vm.itemsPerPage,
|
||||
limit: vm.itemsPerPage,
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
ng-click="vm.orderByVote();"
|
||||
uib-tooltip="{{ 'TABLE_FIELDS.TITLE_VOTES' | translate}}">{{ 'TABLE_FIELDS.VOTES' | translate}}</a>
|
||||
<i class="fa fa-caret-down text-info" ng-if="vm.sortVote == '-'"></i>
|
||||
<i class="fa fa-caret-up text-info" ng-if="vm.sortVote == '+'"></i>
|
||||
</th>
|
||||
<th class="text-center">{{ 'TABLE_FIELDS.LIFETIME' | translate}}</th>
|
||||
<th class="text-center">{{ 'TABLE_FIELDS.SIZE' | translate}}</th>
|
||||
|
||||
Reference in New Issue
Block a user