diff --git a/config/env/torrents.js b/config/env/torrents.js index b64c248d..298ba93b 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -243,7 +243,6 @@ module.exports = { * @position: position of submenu item(ordered index) * @state: angular state of torrent type, this state value used in module route config * @url: window location url of type - * @viewTemplateUrl: view templateUrl value of state * @pageTitle: the page title string, used by translate * @uploadTemplateID: view templateID in upload torrent page, when selected type is changed, then include the template by this id, * all the template html is in file: modules/torrents/client/views/uploads-torrents.client.view.html @@ -265,7 +264,6 @@ module.exports = { position: 1, state: 'torrents.movie', url: '/movie', - viewTemplateUrl: '/modules/torrents/client/views/list-movie.client.view.html', pageTitle: 'MOVIE_LIST', uploadTemplateID: 'movie' }, @@ -278,7 +276,6 @@ module.exports = { position: 2, state: 'torrents.tvserial', url: '/tv', - viewTemplateUrl: '/modules/torrents/client/views/list-tv.client.view.html', pageTitle: 'TV_LIST', uploadTemplateID: 'tvserial' }, @@ -291,7 +288,6 @@ module.exports = { position: 3, state: 'torrents.music', url: '/music', - viewTemplateUrl: '/modules/torrents/client/views/list-music.client.view.html', pageTitle: 'MUSIC_LIST', uploadTemplateID: 'music' }, @@ -304,7 +300,6 @@ module.exports = { position: 4, state: 'torrents.variety', url: '/variety', - viewTemplateUrl: '/modules/torrents/client/views/list-variety.client.view.html', pageTitle: 'VARIETY_LIST', uploadTemplateID: 'variety' }, @@ -317,7 +312,6 @@ module.exports = { position: 4, state: 'torrents.software', url: '/software', - viewTemplateUrl: '/modules/torrents/client/views/list-software.client.view.html', pageTitle: 'SOFTWARE_LIST', uploadTemplateID: 'default' }, @@ -330,7 +324,6 @@ module.exports = { position: 4, state: 'torrents.ebook', url: '/ebook', - viewTemplateUrl: '/modules/torrents/client/views/list-ebook.client.view.html', pageTitle: 'EBOOK_LIST', uploadTemplateID: 'default' }, @@ -343,7 +336,6 @@ module.exports = { position: 5, state: 'torrents.other', url: '/other', - viewTemplateUrl: '/modules/torrents/client/views/list-other.client.view.html', pageTitle: 'OTHER_LIST', uploadTemplateID: 'default' } diff --git a/modules/core/client/directives/music-disk.client.directive.js b/modules/core/client/directives/music-disk.client.directive.js index bdc26fe0..5399c293 100644 --- a/modules/core/client/directives/music-disk.client.directive.js +++ b/modules/core/client/directives/music-disk.client.directive.js @@ -23,6 +23,7 @@ cir1.css('border', 'solid 2px #515151'); cir1.css('background-color', '#ddd'); cir1.css('padding', '1px'); + cir1.attr('title', attrs.alt); var cir2 = angular.element('
'); cir2.css('border-radius', '50%'); @@ -30,7 +31,7 @@ cir2.css('background-size', '100% 100%'); cir2.css('height', '100%'); cir2.css('width', '100%'); - cir2.css('padding', '22px'); + cir2.css('padding', '36%'); var cir3 = angular.element(''); cir3.css('border-radius', '50%'); diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index 744e8505..a2d4bb2a 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -154,6 +154,27 @@ body { margin-bottom: 0; } } + .music { + margin: 35px 0; + overflow: hidden; + opacity: 0.8; + &:hover { + opacity: 1; + } + &::before { + content: ' '; + padding-top: 100%; /* vertical value as 100% equals width */ + float: left; + } + div { + overflow: hidden; + &::before { + content: ' '; + padding-top: 100%; /* vertical value as 100% equals width */ + float: left; + } + } + } } .torrent-votes { diff --git a/modules/torrents/client/config/torrents.client.routes.js b/modules/torrents/client/config/torrents.client.routes.js index 7f990bcc..e95a9b1f 100644 --- a/modules/torrents/client/config/torrents.client.routes.js +++ b/modules/torrents/client/config/torrents.client.routes.js @@ -34,7 +34,7 @@ $stateProvider .state(cfg.state, { url: cfg.url, - templateUrl: cfg.viewTemplateUrl, + templateUrl: '/modules/torrents/client/views/list-torrents.client.view.html', data: { pageTitle: 'PAGETITLE.' + cfg.pageTitle, torrentType: cfg.value diff --git a/modules/torrents/client/controllers/admin/admin-list.client.controller.js b/modules/torrents/client/controllers/admin/admin-list.client.controller.js index 92e8ef74..5601c166 100644 --- a/modules/torrents/client/controllers/admin/admin-list.client.controller.js +++ b/modules/torrents/client/controllers/admin/admin-list.client.controller.js @@ -503,7 +503,7 @@ vm.getTorrentListImage = function (item) { var result = null; - switch (vm.selectedType) { + switch (item.torrent_type) { case 'movie': case 'tvserial': result = vm.tmdbConfig.posterListBaseUrl + item.resource_detail_info.poster_path; @@ -523,7 +523,7 @@ vm.getTorrentTitle = function (item) { var result = null; - switch (vm.selectedType) { + switch (item.torrent_type) { case 'movie': result = item.resource_detail_info.original_title; break; @@ -545,7 +545,7 @@ vm.getTorrentOriginalTitle = function (item) { var result = null; - switch (vm.selectedType) { + switch (item.torrent_type) { case 'movie': if (item.resource_detail_info.original_title !== item.resource_detail_info.title) { result = item.resource_detail_info.title; diff --git a/modules/torrents/client/controllers/torrents.client.controller.js b/modules/torrents/client/controllers/torrents.client.controller.js index 8ca7ac14..41ff3da5 100644 --- a/modules/torrents/client/controllers/torrents.client.controller.js +++ b/modules/torrents/client/controllers/torrents.client.controller.js @@ -19,6 +19,7 @@ vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags; vm.torrentSalesType = MeanTorrentConfig.meanTorrentConfig.torrentSalesType; vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage; + vm.voteTitleConfig = MeanTorrentConfig.meanTorrentConfig.voteTitle; vm.searchTags = []; vm.searchKey = ''; @@ -90,6 +91,7 @@ torrent_status: 'reviewed', torrent_type: vm.torrentType }, function (items) { + mtDebug.info(items); vm.listTopInfo = items.rows; if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInList) { @@ -324,5 +326,99 @@ var url = $state.href('torrents.view', {torrentId: id}); $window.open(url, '_blank'); }; + + /** + * 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; + }; + + /** + * getTorrentListTopImage + * @param item + * @returns {string} + */ + vm.getTorrentListTopImage = function (item) { + var result = null; + + switch (item.torrent_type) { + case 'movie': + case 'tvserial': + result = vm.tmdbConfig.posterImgBaseUrl + 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; + }; } }()); diff --git a/modules/torrents/client/views/admin/admin-list.client.view.html b/modules/torrents/client/views/admin/admin-list.client.view.html index 2553d28a..e65b110c 100644 --- a/modules/torrents/client/views/admin/admin-list.client.view.html +++ b/modules/torrents/client/views/admin/admin-list.client.view.html @@ -52,7 +52,7 @@ -