From bd2bc6e301fc5fbb5807ee27885a2316c436bd2e Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sun, 4 Feb 2018 11:22:56 +0000 Subject: [PATCH] Disable forget download feature, httprequest missing from runtime --- .../Source/Plugin/TV.class.php | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php index 54bbe3b..5f374ee 100644 --- a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php +++ b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php @@ -334,41 +334,41 @@ EOSH; } protected function forgetDownload($series, $season, $episode) { - $base_url = $this->config->get('sources.TV.flexget-url'); - $username = $this->config->get('sources.TV.flexget-username'); - $password = $this->config->get('sources.TV.flexget-password'); - - // Pad series and episode numbers with leading zeroes for flexget - $season = str_pad($season, 2, '0', STR_PAD_LEFT); - $episode = str_pad($episode, 2, '0', STR_PAD_LEFT); - - $url = "{$base_url}execute/"; - $data = array( - 'options' => "--series-forget '{$series}' 's{$season}e{$episode}'", - 'submit' => 'Start Execution', - ); - - DownloadDispatcher_LogEntry::debug($this->log, "Sending flexget series-forget command to {$url} with options '{$data['options']}'."); - - $request = new HttpRequest($url, HTTP_METH_POST, array( - 'httpauth' => "{$username}:{$password}", - 'httpauthtype' => HTTP_AUTH_BASIC, - )); - $request->setPostFields($data); - - $response = $request->send(); - DownloadDispatcher_LogEntry::debug($this->log, "Response code: {$response->getResponseCode()}."); - - if ($response->getResponseCode() == 200) { - $response_body = $response->getBody(); - if (preg_match('/Removed episode .* from series .*/', $response_body)) { - DownloadDispatcher_LogEntry::info($this->log, "Successfully made flexget forget about {$series} s{$season}e{$episode}."); - } else { - DownloadDispatcher_LogEntry::warning($this->log, "Failed to make flexget forget about {$series} s{$season}e{$episode}."); - } - } else { - DownloadDispatcher_LogEntry::warning($this->log, "Failed to communicate with flexget webui."); - } + #$base_url = $this->config->get('sources.TV.flexget-url'); + #$username = $this->config->get('sources.TV.flexget-username'); + #$password = $this->config->get('sources.TV.flexget-password'); + # + #// Pad series and episode numbers with leading zeroes for flexget + #$season = str_pad($season, 2, '0', STR_PAD_LEFT); + #$episode = str_pad($episode, 2, '0', STR_PAD_LEFT); + # + #$url = "{$base_url}execute/"; + #$data = array( + # 'options' => "--series-forget '{$series}' 's{$season}e{$episode}'", + # 'submit' => 'Start Execution', + #); + # + #DownloadDispatcher_LogEntry::debug($this->log, "Sending flexget series-forget command to {$url} with options '{$data['options']}'."); + # + #$request = new HttpRequest($url, HTTP_METH_POST, array( + # 'httpauth' => "{$username}:{$password}", + # 'httpauthtype' => HTTP_AUTH_BASIC, + #)); + #$request->setPostFields($data); + # + #$response = $request->send(); + #DownloadDispatcher_LogEntry::debug($this->log, "Response code: {$response->getResponseCode()}."); + # + #if ($response->getResponseCode() == 200) { + # $response_body = $response->getBody(); + # if (preg_match('/Removed episode .* from series .*/', $response_body)) { + # DownloadDispatcher_LogEntry::info($this->log, "Successfully made flexget forget about {$series} s{$season}e{$episode}."); + # } else { + # DownloadDispatcher_LogEntry::warning($this->log, "Failed to make flexget forget about {$series} s{$season}e{$episode}."); + # } + #} else { + # DownloadDispatcher_LogEntry::warning($this->log, "Failed to communicate with flexget webui."); + #} } }