diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js index c3db7976..7c9e804e 100644 --- a/modules/core/client/controllers/home.client.controller.js +++ b/modules/core/client/controllers/home.client.controller.js @@ -263,6 +263,365 @@ }); }; + /** + * getMovieTopInfo + */ + vm.getMovieTopInfo = function () { + vm.moviesInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'movie', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.movieTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.movieTopList = items.rows; + + vm.initTopOneMovieInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.movieTopOne); + ScrapeService.scrapeTorrent(vm.movieTopList); + } + } + }, function (err) { + Notification.error({ + message: ' ' + $translate.instant('TOP_MOVIE_INFO_ERROR') + }); + }); + + vm.moviesInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'movie', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.movieNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.movieNewList); + } + } + }, function (err) { + Notification.error({ + message: ' ' + $translate.instant('TOP_MOVIE_INFO_ERROR') + }); + }); + }; + + /** + * getTVTopInfo + */ + vm.getTVTopInfo = function () { + vm.tvsInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'tvserial', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.TVTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.TVTopList = items.rows; + + vm.initTopOneTVInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.TVTopOne); + ScrapeService.scrapeTorrent(vm.TVTopList); + } + } + }); + + vm.tvsInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'tvserial', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.TVNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.TVNewList); + } + } + }); + }; + + /** + * getMusicTopInfo + */ + vm.getMusicTopInfo = function () { + vm.musicInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'music', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + 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: 13 + }, function (items) { + if (items.rows.length > 0) { + vm.musicNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.musicNewList); + } + } + }); + }; + + /** + * getSportsTopInfo + */ + vm.getSportsTopInfo = function () { + vm.sportsInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'sports', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.sportsTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.sportsTopList = items.rows; + + vm.initTopOneSportsInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.sportsTopOne); + ScrapeService.scrapeTorrent(vm.sportsTopList); + } + } + }); + + vm.sportsInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'sports', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.sportsNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.sportsNewList); + } + } + }); + }; + + /** + * getVarietyTopInfo + */ + vm.getVarietyTopInfo = function () { + vm.varietyInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'variety', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.varietyTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.varietyTopList = items.rows; + + vm.initTopOneVarietyInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.varietyTopOne); + ScrapeService.scrapeTorrent(vm.varietyTopList); + } + } + }); + + vm.varietyInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'variety', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.varietyNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.varietyNewList); + } + } + }); + }; + + /** + * getPictureTopInfo + */ + vm.getPictureTopInfo = function () { + vm.pictureInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'picture', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.pictureTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.pictureTopList = items.rows; + + vm.initTopOnePictureInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.pictureTopOne); + ScrapeService.scrapeTorrent(vm.pictureTopList); + } + } + }); + + vm.pictureInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'picture', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.pictureNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.pictureNewList); + } + } + }); + }; + + /** + * getGameTopInfo + */ + vm.getGameTopInfo = function () { + vm.gameInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'game', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.gameTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.gameTopList = items.rows; + + vm.initTopOneGameInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.gameTopOne); + ScrapeService.scrapeTorrent(vm.gameTopList); + } + } + }); + + vm.gameInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'game', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.gameNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.gameNewList); + } + } + }); + }; + + /** + * getSoftwareTopInfo + */ + vm.getSoftwareTopInfo = function () { + vm.softwareInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'software', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.softwareTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.softwareTopList = items.rows; + + vm.initTopOneSoftwareInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.softwareTopOne); + ScrapeService.scrapeTorrent(vm.softwareTopList); + } + } + }); + + vm.softwareInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'software', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.softwareNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.softwareNewList); + } + } + }); + }; + + /** + * getEbookTopInfo + */ + vm.getEbookTopInfo = function () { + vm.ebookInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'ebook', + limit: 9 + }, function (items) { + if (items.rows.length > 0) { + vm.ebookTopOne = items.rows[0]; + items.rows.splice(0, 1); + vm.ebookTopList = items.rows; + + vm.initTopOneEbookInfo(); + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.ebookTopOne); + ScrapeService.scrapeTorrent(vm.ebookTopList); + } + } + }); + + vm.ebookInfo = TorrentsService.get({ + torrent_status: 'reviewed', + torrent_type: 'ebook', + newest: true, + limit: 14 + }, function (items) { + if (items.rows.length > 0) { + vm.ebookNewList = items.rows; + + if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) { + ScrapeService.scrapeTorrent(vm.ebookNewList); + } + } + }); + }; + /** * getOverviewMarkedContent * @param t diff --git a/modules/core/client/views/home.client.view.html b/modules/core/client/views/home.client.view.html index 729c9e2e..73fe86e2 100644 --- a/modules/core/client/views/home.client.view.html +++ b/modules/core/client/views/home.client.view.html @@ -1,8 +1,8 @@ -
+
-
+
{{'MENU_TORRENTS_SUB.MOVIE' | translate}}
@@ -221,7 +221,7 @@ -
+
{{'MENU_TORRENTS_SUB.TVSERIAL' | translate}}
@@ -449,7 +449,7 @@ -
+
{{'MENU_TORRENTS_SUB.MUSIC' | translate}}
@@ -629,7 +629,7 @@ -
+
{{'MENU_TORRENTS_SUB.SPORTS' | translate}}
@@ -801,7 +801,7 @@ -
+
{{'MENU_TORRENTS_SUB.VARIETY' | translate}}
@@ -973,7 +973,7 @@ -
+
{{'MENU_TORRENTS_SUB.PICTURE' | translate}}
@@ -1145,7 +1145,7 @@ -
+
{{'MENU_TORRENTS_SUB.GAME' | translate}}
@@ -1317,7 +1317,7 @@ -
+
{{'MENU_TORRENTS_SUB.SOFTWARE' | translate}}
@@ -1489,7 +1489,7 @@ -
+
{{'MENU_TORRENTS_SUB.EBOOK' | translate}}