Move all the config files to newznab/config folder.

This commit is contained in:
DariusIII
2015-10-15 10:55:05 +02:00
parent 67fac3d0c9
commit e00244af1c
521 changed files with 1921 additions and 1128 deletions
+49 -34
View File
@@ -4,6 +4,23 @@ namespace newznab\processing;
use \newznab\db\Settings;
use \newznab\processing\post\AniDB;
use \newznab\processing\post\ProcessAdditional;
use newznab\controllers\Logger;
use newznab\controllers\NameFixer;
use newznab\controllers\Groups;
use newznab\controllers\Nfo;
use newznab\controllers\ReleaseFiles;
use newznab\controllers\Category;
use newznab\controllers\Books;
use newznab\controllers\Console;
use newznab\controllers\Movie;
use newznab\controllers\TvRage;
use newznab\controllers\XXX;
use newznab\controllers\Sharing;
use newznab\controllers\Games;
use newznab\controllers\Music;
use newznab\controllers\NNTP;
use newznab\controllers\TheTVDB;
use newznab\controllers\SpotNab;
require_once NN_LIBS . 'rarinfo/par2info.php';
@@ -17,13 +34,13 @@ class PostProcess
/**
* Class instance of debugging.
*
* @var \Logger
* @var Logger
*/
protected $debugging;
/**
* Instance of NameFixer.
* @var \NameFixer
* @var NameFixer
*/
protected $nameFixer;
@@ -51,17 +68,17 @@ class PostProcess
private $echooutput;
/**
* @var \Groups
* @var Groups
*/
private $groups;
/**
* @var \Nfo
* @var Nfo
*/
private $Nfo;
/**
* @var \ReleaseFiles
* @var ReleaseFiles
*/
private $releaseFiles;
@@ -86,16 +103,14 @@ class PostProcess
//\\ Various.
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
//\\
$s = new \Sites();
$this->site = $s->get();
//\\ Class instances.
$this->pdo = (($options['Settings'] instanceof Settings) ? $options['Settings'] : new Settings());
$this->groups = (($options['Groups'] instanceof \Groups) ? $options['Groups'] : new \Groups());
$this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups());
$this->_par2Info = new \Par2Info();
$this->debugging = ($options['Logger'] instanceof \Logger ? $options['Logger'] : new \Logger(['ColorCLI' => $this->pdo->log]));
$this->nameFixer = (($options['NameFixer'] instanceof \NameFixer) ? $options['NameFixer'] : new \NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups]));
$this->Nfo = (($options['Nfo'] instanceof \Nfo ) ? $options['Nfo'] : new \Nfo(['Echo' => $this->echooutput, 'Settings' => $this->pdo]));
$this->releaseFiles = (($options['ReleaseFiles'] instanceof \ReleaseFiles) ? $options['ReleaseFiles'] : new \ReleaseFiles($this->pdo));
$this->debugging = ($options['Logger'] instanceof Logger ? $options['Logger'] : new Logger(['ColorCLI' => $this->pdo->log]));
$this->nameFixer = (($options['NameFixer'] instanceof NameFixer) ? $options['NameFixer'] : new NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups]));
$this->Nfo = (($options['Nfo'] instanceof Nfo ) ? $options['Nfo'] : new Nfo(['Echo' => $this->echooutput, 'Settings' => $this->pdo]));
$this->releaseFiles = (($options['ReleaseFiles'] instanceof ReleaseFiles) ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo));
//\\
//\\ Site settings.
@@ -148,7 +163,7 @@ class PostProcess
public function processBooks()
{
if ($this->pdo->getSetting('lookupbooks') != 0) {
(new \Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo, ]))->processBookReleases();
(new Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo, ]))->processBookReleases();
}
}
@@ -160,7 +175,7 @@ class PostProcess
public function processConsoles()
{
if ($this->pdo->getSetting('lookupgames') != 0) {
(new \Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
(new Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
}
}
@@ -172,7 +187,7 @@ class PostProcess
public function processGames()
{
if ($this->pdo->getSetting('lookupgames') != 0) {
(new \Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
(new Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
}
}
@@ -190,7 +205,7 @@ class PostProcess
{
$processMovies = (is_numeric($processMovies) ? $processMovies : $this->pdo->getSetting('lookupimdb'));
if ($processMovies > 0) {
(new \Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
(new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
}
}
@@ -202,14 +217,14 @@ class PostProcess
public function processMusic()
{
if ($this->pdo->getSetting('lookupmusic') != 0) {
(new \Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
(new Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
}
}
/**
* Process nfo files.
*
* @param \NNTP $nntp
* @param NNTP $nntp
* @param string $groupID (Optional) id of a group to work on.
* @param string $guidChar (Optional) First letter of a release GUID to use to get work.
*
@@ -227,7 +242,7 @@ class PostProcess
*/
public function processSpotnab()
{
$spotnab = new \SpotNab();
$spotnab = new SpotNab();
$processed = $spotnab->processGID(500);
if ($processed > 0) {
if ($this->echooutput) {
@@ -250,7 +265,7 @@ class PostProcess
*/
public function processSharing(&$nntp)
{
(new \Sharing(['Settings' => $this->pdo, 'NNTP' => $nntp]))->start();
(new Sharing(['Settings' => $this->pdo, 'NNTP' => $nntp]))->start();
}
/**
@@ -267,7 +282,7 @@ class PostProcess
{
$processTV = (is_numeric($processTV) ? $processTV : $this->pdo->getSetting('lookuptvrage'));
if ($processTV > 0) {
(new \TvRage(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processTvReleases($groupID, $guidChar, $processTV);
(new TvRage(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processTvReleases($groupID, $guidChar, $processTV);
}
}
@@ -275,7 +290,7 @@ class PostProcess
{
if ($this->pdo->getSetting('lookupthetvdb') == 1)
{
$thetvdb = new \TheTVDB($this->echooutput);
$thetvdb = new TheTVDB($this->echooutput);
$thetvdb->processReleases();
}
}
@@ -286,7 +301,7 @@ class PostProcess
public function processXXX()
{
if ($this->pdo->getSetting('lookupxxx') == 1) {
(new \XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
(new XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
}
}
@@ -295,7 +310,7 @@ class PostProcess
*
* @note Called externally by tmux/bin/update_per_group and update/postprocess.php
*
* @param \NNTP $nntp Class NNTP
* @param NNTP $nntp Class NNTP
* @param int|string $groupID (Optional) id of a group to work on.
* @param string $guidChar (Optional) First char of release GUID, can be used to select work.
*
@@ -314,7 +329,7 @@ class PostProcess
* @param string $messageID MessageID from NZB file.
* @param int $relID id of the release.
* @param int $groupID Group id of the release.
* @param \NNTP $nntp Class NNTP
* @param NNTP $nntp Class NNTP
* @param int $show Only show result or apply iy.
*
* @return bool
@@ -344,15 +359,15 @@ class PostProcess
if (!in_array(
(int)$query['categoryid'],
array(
\Category::CAT_BOOK_OTHER,
\Category::CAT_GAME_OTHER,
\Category::CAT_MOVIE_OTHER,
\Category::CAT_MUSIC_OTHER,
\Category::CAT_PC_MOBILEOTHER,
\Category::CAT_TV_OTHER,
\Category::CAT_MISC_HASHED,
\Category::CAT_XXX_OTHER,
\Category::CAT_MISC_OTHER
Category::CAT_BOOK_OTHER,
Category::CAT_GAME_OTHER,
Category::CAT_MOVIE_OTHER,
Category::CAT_MUSIC_OTHER,
Category::CAT_PC_MOBILEOTHER,
Category::CAT_TV_OTHER,
Category::CAT_MISC_HASHED,
Category::CAT_XXX_OTHER,
Category::CAT_MISC_OTHER
)
)
) {