diff --git a/modules/core/client/controllers/home.client.controller.js b/modules/core/client/controllers/home.client.controller.js
index 7c9e804e..174d5d94 100644
--- a/modules/core/client/controllers/home.client.controller.js
+++ b/modules/core/client/controllers/home.client.controller.js
@@ -155,114 +155,6 @@
}
};
- /**
- * getHomeTorrentList
- */
- vm.getHomeTorrentList = function () {
- vm.homeTorrents = TorrentsService.getHomeTorrent({}, function (items) {
- vm.orderList = items.orderList;
- vm.newestList = items.newestList;
-
- vm.initListData();
-
- if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) {
- ScrapeService.scrapeTorrent(vm.orderList);
- ScrapeService.scrapeTorrent(vm.newestList);
- }
- }, function (err) {
- Notification.error({
- message: ' ' + $translate.instant('TOP_TORRENTS_INFO_ERROR')
- });
- });
- };
-
- /**
- * initListData
- * @param t
- */
- vm.initListData = function () {
- angular.forEach(vm.orderList, function (i) {
- switch (i._id) {
- case 'movie':
- vm.movieTopOne = i.typeTorrents[0] || undefined;
- vm.movieTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneMovieInfo();
- break;
- case 'tvserial':
- vm.TVTopOne = i.typeTorrents[0] || undefined;
- vm.TVTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneTVInfo();
- break;
- case 'music':
- vm.musicTopOne = i.typeTorrents[0] || undefined;
- vm.musicTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneMusicInfo();
- break;
- case 'sports':
- vm.sportsTopOne = i.typeTorrents[0] || undefined;
- vm.sportsTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneSportsInfo();
- break;
- case 'variety':
- vm.varietyTopOne = i.typeTorrents[0] || undefined;
- vm.varietyTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneVarietyInfo();
- break;
- case 'picture':
- vm.pictureTopOne = i.typeTorrents[0] || undefined;
- vm.pictureTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOnePictureInfo();
- break;
- case 'game':
- vm.gameTopOne = i.typeTorrents[0] || undefined;
- vm.gameTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneGameInfo();
- break;
- case 'software':
- vm.softwareTopOne = i.typeTorrents[0] || undefined;
- vm.softwareTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneSoftwareInfo();
- break;
- case 'ebook':
- vm.ebookTopOne = i.typeTorrents[0] || undefined;
- vm.ebookTopList = i.typeTorrents.splice(1, 8) || undefined;
- vm.initTopOneEbookInfo();
- break;
- }
- });
- angular.forEach(vm.newestList, function (i) {
- switch (i._id) {
- case 'movie':
- vm.movieNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'tvserial':
- vm.TVNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'music':
- vm.musicNewList = i.typeTorrents.splice(0, 13) || undefined;
- break;
- case 'sports':
- vm.sportsNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'variety':
- vm.varietyNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'picture':
- vm.pictureNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'game':
- vm.gameNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'software':
- vm.softwareNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- case 'ebook':
- vm.ebookNewList = i.typeTorrents.splice(0, 14) || undefined;
- break;
- }
- });
- };
-
/**
* getMovieTopInfo
*/
diff --git a/modules/vip/client/controllers/vip.client.controller.js b/modules/vip/client/controllers/vip.client.controller.js
index c091a3bd..8c26172e 100644
--- a/modules/vip/client/controllers/vip.client.controller.js
+++ b/modules/vip/client/controllers/vip.client.controller.js
@@ -6,10 +6,12 @@
.controller('VipController', VipController);
VipController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'getStorageLangService', 'MeanTorrentConfig', 'TorrentsService',
- 'DebugConsoleService', '$timeout', 'uibButtonConfig', 'TorrentGetInfoServices', 'DownloadService', 'ResourcesTagsServices', '$window'];
+ 'DebugConsoleService', '$timeout', 'uibButtonConfig', 'TorrentGetInfoServices', 'DownloadService', 'ResourcesTagsServices', '$window',
+ 'localStorageService'];
function VipController($scope, $state, $translate, Authentication, getStorageLangService, MeanTorrentConfig, TorrentsService,
- mtDebug, $timeout, uibButtonConfig, TorrentGetInfoServices, DownloadService, ResourcesTagsServices, $window) {
+ mtDebug, $timeout, uibButtonConfig, TorrentGetInfoServices, DownloadService, ResourcesTagsServices, $window,
+ localStorageService) {
var vm = this;
vm.DLS = DownloadService;
vm.TGI = TorrentGetInfoServices;
@@ -21,7 +23,7 @@
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.torrentType = MeanTorrentConfig.meanTorrentConfig.torrentType;
vm.resourcesTags = MeanTorrentConfig.meanTorrentConfig.resourcesTags;
- vm.vipTorrentType = 'movie';
+ vm.vipTorrentType = localStorageService.get('vip_last_selected_type') || 'movie';
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
vm.searchTags = [];
@@ -237,6 +239,13 @@
});
};
+ /**
+ * onTypeBtnClick
+ */
+ vm.onTypeBtnClick = function () {
+ localStorageService.set('vip_last_selected_type', vm.vipTorrentType);
+ };
+
/**
* onRadioTagClicked
* @param event
diff --git a/modules/vip/client/views/vip.client.view.html b/modules/vip/client/views/vip.client.view.html
index c2f030a6..7c8596e9 100644
--- a/modules/vip/client/views/vip.client.view.html
+++ b/modules/vip/client/views/vip.client.view.html
@@ -38,7 +38,7 @@