mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 11:35:31 +02:00
feat(scrape): scrape torrent status in home
This commit is contained in:
@@ -6,13 +6,15 @@
|
||||
.controller('HomeController', HomeController);
|
||||
|
||||
HomeController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'TorrentsService', 'Notification', 'MeanTorrentConfig',
|
||||
'getStorageLangService', 'DownloadService', '$timeout', 'localStorageService'];
|
||||
'getStorageLangService', 'DownloadService', '$timeout', 'localStorageService', 'ScrapeService'];
|
||||
|
||||
function HomeController($scope, $state, $translate, Authentication, TorrentsService, Notification, MeanTorrentConfig, getStorageLangService,
|
||||
DownloadService, $timeout, localStorageService) {
|
||||
DownloadService, $timeout, localStorageService, ScrapeService) {
|
||||
var vm = this;
|
||||
vm.tmdbConfig = MeanTorrentConfig.meanTorrentConfig.tmdbConfig;
|
||||
vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app;
|
||||
vm.scrapeConfig = MeanTorrentConfig.meanTorrentConfig.scrapeTorrentStatus;
|
||||
vm.announce = MeanTorrentConfig.meanTorrentConfig.announce;
|
||||
|
||||
vm.movieTopOne = undefined;
|
||||
vm.movieTopList = undefined;
|
||||
@@ -97,6 +99,11 @@
|
||||
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({
|
||||
@@ -112,6 +119,10 @@
|
||||
}, 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({
|
||||
@@ -135,6 +146,11 @@
|
||||
vm.TVTopList = items.rows;
|
||||
|
||||
vm.initTopOneTVInfo();
|
||||
|
||||
if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) {
|
||||
ScrapeService.scrapeTorrent(vm.TVTopOne);
|
||||
ScrapeService.scrapeTorrent(vm.TVTopList);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -146,6 +162,10 @@
|
||||
}, function (items) {
|
||||
if (items.rows.length > 0) {
|
||||
vm.TVNewList = items.rows;
|
||||
|
||||
if (!vm.announce.privateTorrentCmsMode && vm.scrapeConfig.onTorrentInHome) {
|
||||
ScrapeService.scrapeTorrent(vm.TVNewList);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user