mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 12:06:14 +02:00
feat(torrents): new TorrentGetInfoServices to get field value of torrent
This commit is contained in:
@@ -7,19 +7,18 @@
|
||||
|
||||
UserController.$inject = ['$scope', '$state', '$window', 'Authentication', 'userResolve', 'Notification', 'NotifycationService', 'MeanTorrentConfig',
|
||||
'AdminService', 'ScoreLevelService', 'PeersService', 'DownloadService', '$translate', 'TorrentsService', 'ModalConfirmService', 'CompleteService',
|
||||
'DebugConsoleService'];
|
||||
'DebugConsoleService', 'TorrentGetInfoServices'];
|
||||
|
||||
function UserController($scope, $state, $window, Authentication, user, Notification, NotifycationService, MeanTorrentConfig, AdminService,
|
||||
ScoreLevelService, PeersService, DownloadService, $translate, TorrentsService, ModalConfirmService, CompleteService,
|
||||
mtDebug) {
|
||||
mtDebug, TGI) {
|
||||
var vm = this;
|
||||
|
||||
vm.TGI = TGI;
|
||||
vm.authentication = Authentication;
|
||||
vm.user = user;
|
||||
vm.selectedRole = vm.user.roles[0];
|
||||
vm.userRolesConfig = MeanTorrentConfig.meanTorrentConfig.userRoles;
|
||||
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
|
||||
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
||||
vm.hnrConfig = MeanTorrentConfig.meanTorrentConfig.hitAndRun;
|
||||
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
|
||||
vm.remove = remove;
|
||||
@@ -27,7 +26,6 @@
|
||||
vm.messageTo = messageTo;
|
||||
vm.isContextUserSelf = isContextUserSelf;
|
||||
vm.scoreLevelData = ScoreLevelService.getScoreLevelJson(vm.user.score);
|
||||
vm.voteTitleConfig = MeanTorrentConfig.meanTorrentConfig.voteTitle;
|
||||
|
||||
vm.searchTags = [];
|
||||
|
||||
@@ -423,79 +421,5 @@
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* getTorrentListImage
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
vm.getTorrentListImage = function (item) {
|
||||
var result = null;
|
||||
|
||||
switch (item.torrent_type) {
|
||||
case 'movie':
|
||||
case 'tvserial':
|
||||
result = vm.tmdbConfig.posterListBaseUrl + item.resource_detail_info.poster_path;
|
||||
break;
|
||||
case 'music':
|
||||
result = '/modules/torrents/client/uploads/cover/' + item.resource_detail_info.cover;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* getTorrentTitle
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
vm.getTorrentTitle = function (item) {
|
||||
var result = null;
|
||||
|
||||
switch (item.torrent_type) {
|
||||
case 'movie':
|
||||
result = item.resource_detail_info.original_title;
|
||||
break;
|
||||
case 'tvserial':
|
||||
result = item.resource_detail_info.original_name;
|
||||
break;
|
||||
case 'music':
|
||||
result = item.resource_detail_info.title;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* getTorrentOriginalTitle
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
vm.getTorrentOriginalTitle = function (item) {
|
||||
var result = null;
|
||||
|
||||
switch (item.torrent_type) {
|
||||
case 'movie':
|
||||
if (item.resource_detail_info.original_title !== item.resource_detail_info.title) {
|
||||
result = item.resource_detail_info.title;
|
||||
}
|
||||
break;
|
||||
case 'tvserial':
|
||||
if (item.resource_detail_info.original_name !== item.resource_detail_info.name) {
|
||||
result = item.resource_detail_info.name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* getVoteTitle
|
||||
* @param item
|
||||
* @returns {string}
|
||||
*/
|
||||
vm.getVoteTitle = function (item) {
|
||||
return item.resource_detail_info.vote_average ? vm.voteTitleConfig.imdb : vm.voteTitleConfig.mt;
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user