mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 10:48:53 +00:00
Update NZBImport to add missing groups, not ignore them when importing nzbs.
This commit is contained in:
@@ -83,6 +83,13 @@ class NZBImport
|
||||
*/
|
||||
public $nzb;
|
||||
|
||||
/**
|
||||
* Access point to add new groups.
|
||||
*
|
||||
* @var Groups $groups
|
||||
*/
|
||||
private $groups;
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
*
|
||||
@@ -115,6 +122,7 @@ class NZBImport
|
||||
$this->crossPostt = ($this->pdo->getSetting('crossposttime') != '') ? $this->pdo->getSetting('crossposttime') : 2;
|
||||
$this->browser = $options['Browser'];
|
||||
$this->retVal = '';
|
||||
$this->groups = new Groups(['Settings' => $this->pdo]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,6 +297,19 @@ class NZBImport
|
||||
if (!$groupName) {
|
||||
$groupName = $group;
|
||||
}
|
||||
} else {
|
||||
$groupID = $this->groups->add([
|
||||
'name' => $group,
|
||||
'description' => 'Added by NZBimport script.',
|
||||
'backfill_target' => 0,
|
||||
'first_record' => 0,
|
||||
'last_record' => 0,
|
||||
'active' => 0,
|
||||
'backfill' => 0
|
||||
]);
|
||||
$this->allGroups[$group] = $groupID;
|
||||
|
||||
$this->echoOut("Adding missing group: ($group)");
|
||||
}
|
||||
}
|
||||
// Add all the found groups to an array.
|
||||
|
||||
Reference in New Issue
Block a user