Disable forget download feature, httprequest missing from runtime
This commit is contained in:
@@ -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.");
|
||||
#}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user