diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index d0316a4d..d5322477 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -6,10 +6,12 @@ .controller('HomeController', HomeController); HomeController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'TorrentsService', 'Notification', 'MeanTorrentConfig', - 'getStorageLangService', 'DownloadService', '$timeout', 'localStorageService', 'ScrapeService', 'TorrentGetInfoServices']; + 'getStorageLangService', 'DownloadService', '$timeout', 'localStorageService', 'ScrapeService', 'TorrentGetInfoServices', 'DebugConsoleService', + 'marked']; function HomeController($scope, $state, $translate, Authentication, TorrentsService, Notification, MeanTorrentConfig, getStorageLangService, - DownloadService, $timeout, localStorageService, ScrapeService, TGI) { + DownloadService, $timeout, localStorageService, ScrapeService, TGI, mtDebug, + marked) { var vm = this; vm.TGI = TGI; vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig; @@ -64,6 +66,15 @@ } }; + /** + * initTopOneMusicInfo + */ + vm.initTopOneMusicInfo = function () { + if (vm.musicTopOne.resource_detail_info.cover) { + $('.music-backdrop').css('backgroundImage', 'url(/modules/torrents/client/uploads/cover/' + vm.musicTopOne.resource_detail_info.cover + ')'); + } + }; + /** * getTorrentTypeEnabled */ @@ -166,7 +177,7 @@ } }); - vm.moviesInfo = TorrentsService.get({ + vm.tvsInfo = TorrentsService.get({ torrent_status: 'reviewed', torrent_type: 'tvserial', newest: true, @@ -182,6 +193,47 @@ }); }; + /** + * getMusicTopInfo + */ + vm.getMusicTopInfo = function () { + vm.musicInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'music', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + mtDebug.info(items); + + vm.musicTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.musicTopList = items.rows; + + vm.initTopOneMusicInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.musicTopOne); + ScrapeService.scrapeTorrent(vm.musicTopList); + } + } + }); + + vm.musicInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'music', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.musicNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.musicNewList); + } + } + }); + }; + /** * openTorrentInfo * @param id @@ -210,5 +262,18 @@ }); }); }; + + /** + * getOverviewMarkedContent + * @param t + * @returns {*} + */ + vm.getOverviewMarkedContent = function (c) { + if (c) { + return marked(c, {sanitize: true}); + } else { + return ''; + } + }; } }()); diff --git a/modules/core/client/less/mt.less b/modules/core/client/less/mt.less index b4b0dc04..da9c9f8c 100644 --- a/modules/core/client/less/mt.less +++ b/modules/core/client/less/mt.less @@ -63,8 +63,8 @@ body { color: #fff; opacity: 0.15; position: absolute; - right: 10px; - top: -20px; + right: 20px; + top: -10px; font-size: 100px; font-weight: bold; } @@ -141,7 +141,7 @@ body { } } } - .music-overview { + .music-detail { p { > img { max-width: 100% !important; @@ -150,6 +150,20 @@ body { } } } + .music-overview { + max-height: 400px; + overflow: auto; + padding-right: 5px; + &::-webkit-scrollbar { + width: 5px; + } + &::-webkit-scrollbar-track { + background-color: #000; + } + &::-webkit-scrollbar-thumb { + background-color: #555; + } + } } } diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 3b103661..41fdf223 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -423,6 +423,57 @@ +