Browse Source

update downloader refresh times to be independent

CauseFX 4 years ago
parent
commit
286b276916

+ 7 - 0
api/config/default.php

@@ -91,17 +91,20 @@ return array(
 	'sickrageToken' => '',
 	'jdownloaderURL' => '',
 	'jdownloaderCombine' => false,
+	'jdownloaderRefresh' => '60000',
 	'sabnzbdURL' => '',
 	'sabnzbdToken' => '',
 	'sabnzbdSocksEnabled' => false,
 	'sabnzbdSocksAuth' => '999',
 	'sabnzbdCombine' => false,
+	'sabnzbdRefresh' => '60000',
 	'nzbgetURL' => '',
 	'nzbgetUsername' => '',
 	'nzbgetPassword' => '',
 	'nzbgetSocksEnabled' => false,
 	'nzbgetSocksAuth' => '999',
 	'nzbgetCombine' => false,
+	'nzbgetRefresh' => '60000',
 	'transmissionURL' => '',
 	'transmissionUsername' => '',
 	'transmissionPassword' => '',
@@ -109,11 +112,13 @@ return array(
 	'transmissionHideCompleted' => false,
 	'transmissionCombine' => false,
 	'transmissionDisableCertCheck' => false,
+	'transmissionRefresh' => '60000',
 	'delugeURL' => '',
 	'delugePassword' => '',
 	'delugeHideSeeding' => false,
 	'delugeHideCompleted' => false,
 	'delugeCombine' => false,
+	'delugeRefresh' => '60000',
 	'qBittorrentURL' => '',
 	'qBittorrentUsername' => '',
 	'qBittorrentPassword' => '',
@@ -124,6 +129,7 @@ return array(
 	'qBittorrentCombine' => false,
 	'qBittorrentApiVersion' => '1',
 	'qBittorrentDisableCertCheck' => false,
+	'qBittorrentRefresh' => '60000',
 	'rTorrentURL' => '',
 	'rTorrentURLOverride' => '',
 	'rTorrentUsername' => '',
@@ -135,6 +141,7 @@ return array(
 	'rTorrentCombine' => false,
 	'rTorrentDisableCertCheck' => false,
 	'rTorrentLimit' => '200',
+	'rTorrentRefresh' => '60000',
 	'homepageJackettEnabled' => false,
 	'homepageJackettAuth' => '1',
 	'jackettURL' => '',

+ 3 - 3
api/homepage/deluge.php

@@ -82,9 +82,9 @@ trait DelugeHomepageItem
 					),
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'delugeRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['delugeRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -167,7 +167,7 @@ trait DelugeHomepageItem
 					<script>
 		                // homepageOrderdeluge
 		                ' . $builder . '
-		                homepageDownloader("deluge", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("deluge", "' . $this->config['delugeRefresh'] . '");
 		                // End homepageOrderdeluge
 	                </script>
 				</div>

+ 6 - 6
api/homepage/jdownloader.php

@@ -63,9 +63,9 @@ trait JDownloaderHomepageItem
 				'Misc Options' => array(
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'jdownloaderRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['jdownloaderRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -102,7 +102,7 @@ trait JDownloaderHomepageItem
 		}
 		$url = $this->qualifyURL($this->config['jdownloaderURL']);
 		try {
-			$options = $this->requestOptions($this->config['jdownloaderURL'], false, $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['jdownloaderURL'], false, $this->config['jdownloaderRefresh']);
 			$response = Requests::get($url, array(), $options);
 			if ($response->success) {
 				$this->setAPIResponse('success', 'API Connection succeeded', 200);
@@ -153,7 +153,7 @@ trait JDownloaderHomepageItem
 					<script>
 		                // homepageOrderjdownloader
 		                ' . $builder . '
-		                homepageDownloader("jdownloader", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("jdownloader", "' . $this->config['jdownloaderRefresh'] . '");
 		                // End homepageOrderjdownloader
 	                </script>
 				</div>
@@ -168,7 +168,7 @@ trait JDownloaderHomepageItem
 		}
 		$url = $this->qualifyURL($this->config['jdownloaderURL']);
 		try {
-			$options = $this->requestOptions($this->config['jdownloaderURL'], false, $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['jdownloaderURL'], false, $this->config['jdownloaderRefresh']);
 			$response = Requests::get($url, array(), $options);
 			if ($response->success) {
 				$temp = json_decode($response->body, true);
@@ -204,4 +204,4 @@ trait JDownloaderHomepageItem
 		$this->setAPIResponse('success', null, 200, $api);
 		return $api;
 	}
-}
+}

+ 3 - 3
api/homepage/nzbget.php

@@ -82,9 +82,9 @@ trait NZBGetHomepageItem
 				'Misc Options' => array(
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'nzbgetRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['nzbgetRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -177,7 +177,7 @@ trait NZBGetHomepageItem
 					<script>
 		                // homepageOrdernzbget
 		                ' . $builder . '
-		                homepageDownloader("nzbget", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("nzbget", "' . $this->config['nzbgetRefresh'] . '");
 		                // End homepageOrdernzbget
 	                </script>
 				</div>

+ 5 - 5
api/homepage/qbittorrent.php

@@ -93,9 +93,9 @@ trait QBitTorrentHomepageItem
 					),
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'qBittorrentRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['qBittorrentRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -136,7 +136,7 @@ trait QBitTorrentHomepageItem
 		$apiVersionQuery = ($this->config['qBittorrentApiVersion'] == '1') ? '/query/torrents?sort=' : '/api/v2/torrents/info?sort=';
 		$url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . $apiVersionLogin;
 		try {
-			$options = $this->requestOptions($this->config['qBittorrentURL'], $this->config['qBittorrentDisableCertCheck'], $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['qBittorrentURL'], $this->config['qBittorrentDisableCertCheck'], $this->config['qBittorrentRefresh']);
 			$response = Requests::post($url, array(), $data, $options);
 			$reflection = new ReflectionClass($response->cookies);
 			$cookie = $reflection->getProperty("cookies");
@@ -209,7 +209,7 @@ trait QBitTorrentHomepageItem
 					<script>
 		                // homepageOrderqBittorrent
 		                ' . $builder . '
-		                homepageDownloader("qBittorrent", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("qBittorrent", "' . $this->config['qBittorrentRefresh'] . '");
 		                // End homepageOrderqBittorrent
 	                </script>
 				</div>
@@ -228,7 +228,7 @@ trait QBitTorrentHomepageItem
 		$apiVersionQuery = ($this->config['qBittorrentApiVersion'] == '1') ? '/query/torrents?sort=' : '/api/v2/torrents/info?sort=';
 		$url = $digest['scheme'] . '://' . $digest['host'] . $digest['port'] . $digest['path'] . $apiVersionLogin;
 		try {
-			$options = $this->requestOptions($this->config['qBittorrentURL'], $this->config['qBittorrentDisableCertCheck'], $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['qBittorrentURL'], $this->config['qBittorrentDisableCertCheck'], $this->config['qBittorrentRefresh']);
 			$response = Requests::post($url, array(), $data, $options);
 			$reflection = new ReflectionClass($response->cookies);
 			$cookie = $reflection->getProperty("cookies");

+ 3 - 3
api/homepage/rtorrent.php

@@ -123,9 +123,9 @@ trait RTorrentHomepageItem
 					),
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'rTorrentRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['rTorrentRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -228,7 +228,7 @@ trait RTorrentHomepageItem
 					<script>
 		                // homepageOrderrTorrent
 		                ' . $builder . '
-		                homepageDownloader("rTorrent", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("rTorrent", "' . $this->config['rTorrentRefresh'] . '");
 		                // End homepageOrderrTorrent
 	                </script>
 				</div>

+ 3 - 3
api/homepage/sabnzbd.php

@@ -77,9 +77,9 @@ trait SabNZBdHomepageItem
 				'Misc Options' => array(
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'sabnzbdRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['sabnzbdRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -178,7 +178,7 @@ trait SabNZBdHomepageItem
 					<script>
 		                // homepageOrdersabnzbd
 		                ' . $builder . '
-		                homepageDownloader("sabnzbd", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("sabnzbd", "' . $this->config['sabnzbdRefresh'] . '");
 		                // End homepageOrdersabnzbd
 	                </script>
 				</div>

+ 5 - 5
api/homepage/transmission.php

@@ -73,9 +73,9 @@ trait TransmissionHomepageItem
 					),
 					array(
 						'type' => 'select',
-						'name' => 'homepageDownloadRefresh',
+						'name' => 'transmissionRefresh',
 						'label' => 'Refresh Seconds',
-						'value' => $this->config['homepageDownloadRefresh'],
+						'value' => $this->config['transmissionRefresh'],
 						'options' => $this->timeOptions()
 					),
 					array(
@@ -114,7 +114,7 @@ trait TransmissionHomepageItem
 		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . rawurlencode($this->decrypt($this->config['transmissionPassword'])) . "@" : '';
 		$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . '/rpc';
 		try {
-			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['transmissionRefresh']);
 			$response = Requests::get($url, array(), $options);
 			if ($response->headers['x-transmission-session-id']) {
 				$headers = array(
@@ -185,7 +185,7 @@ trait TransmissionHomepageItem
 					<script>
 		                // homepageOrdertransmission
 		                ' . $builder . '
-		                homepageDownloader("transmission", "' . $this->config['homepageDownloadRefresh'] . '");
+		                homepageDownloader("transmission", "' . $this->config['transmissionRefresh'] . '");
 		                // End homepageOrdertransmission
 	                </script>
 				</div>
@@ -202,7 +202,7 @@ trait TransmissionHomepageItem
 		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . rawurlencode($this->decrypt($this->config['transmissionPassword'])) . "@" : '';
 		$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . '/rpc';
 		try {
-			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['homepageDownloadRefresh']);
+			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['transmissionRefresh']);
 			$response = Requests::get($url, array(), $options);
 			if ($response->headers['x-transmission-session-id']) {
 				$headers = array(