mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-28 17:01:16 +00:00
Delete releases that report missing, broken or empty nzbs on PPA stage
This commit is contained in:
@@ -809,24 +809,24 @@ class ProcessAdditional
|
||||
{
|
||||
$nzbPath = $this->_nzb->NZBPath($this->_release->guid);
|
||||
if ($nzbPath === false) {
|
||||
$this->_echo('NZB not found for GUID: '.$this->_release->guid, 'warning');
|
||||
$this->_echo('NZB not found for GUID: '.$this->_release->guid . ', deleting the release.', 'warning');
|
||||
|
||||
return $this->_decrementPasswordStatus();
|
||||
Release::query()->where('guid', $this->_release->guid)->delete();
|
||||
}
|
||||
|
||||
$nzbContents = Utility::unzipGzipFile($nzbPath);
|
||||
if (! $nzbContents) {
|
||||
$this->_echo('NZB is empty or broken for GUID: '.$this->_release->guid, 'warning');
|
||||
$this->_echo('NZB is empty or broken for GUID: '.$this->_release->guid. ', deleting the release.', 'warning');
|
||||
|
||||
return $this->_decrementPasswordStatus();
|
||||
Release::query()->where('guid', $this->_release->guid)->delete();
|
||||
}
|
||||
|
||||
// Get a list of files in the nzb.
|
||||
$this->_nzbContents = $this->_nzb->nzbFileList($nzbContents, ['no-file-key' => false, 'strip-count' => true]);
|
||||
if (\count($this->_nzbContents) === 0) {
|
||||
$this->_echo('NZB is potentially broken for GUID: '.$this->_release->guid, 'warning');
|
||||
$this->_echo('NZB is potentially broken for GUID: '.$this->_release->guid .'deleting the release.', 'warning');
|
||||
|
||||
return $this->_decrementPasswordStatus();
|
||||
Release::query()->where('guid', $this->_release->guid)->delete();
|
||||
}
|
||||
// Sort keys.
|
||||
ksort($this->_nzbContents, SORT_NATURAL);
|
||||
|
||||
Reference in New Issue
Block a user