mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-09-01 02:38:55 +00:00
Move from nntmux/db/Settings to app/models/Settings
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace nntmux\processing;
|
||||
|
||||
use app\models\Settings;
|
||||
use dariusiii\rarinfo\Par2Info;
|
||||
use nntmux\Books;
|
||||
use nntmux\Category;
|
||||
@@ -19,7 +20,7 @@ use nntmux\processing\tv\TMDB;
|
||||
use nntmux\processing\tv\TraktTv;
|
||||
use nntmux\XXX;
|
||||
use nntmux\ReleaseFiles;
|
||||
use nntmux\db\Settings;
|
||||
use nntmux\db\DB;
|
||||
use nntmux\processing\post\AniDB;
|
||||
use nntmux\processing\post\ProcessAdditional;
|
||||
use nntmux\SpotNab;
|
||||
@@ -109,7 +110,7 @@ class PostProcess
|
||||
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
|
||||
|
||||
// Class instances.
|
||||
$this->pdo = (($options['Settings'] instanceof Settings) ? $options['Settings'] : new Settings());
|
||||
$this->pdo = (($options['Settings'] instanceof DB) ? $options['Settings'] : new DB());
|
||||
$this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups(['Settings' => $this->pdo]));
|
||||
$this->_par2Info = new Par2Info();
|
||||
$this->debugging = ($options['Logger'] instanceof Logger ? $options['Logger'] : new Logger(['ColorCLI' => $this->pdo->log]));
|
||||
@@ -118,8 +119,8 @@ class PostProcess
|
||||
$this->releaseFiles = (($options['ReleaseFiles'] instanceof ReleaseFiles) ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo));
|
||||
|
||||
// Site settings.
|
||||
$this->addpar2 = ($this->pdo->getSetting('addpar2') == 0) ? false : true;
|
||||
$this->alternateNNTP = ($this->pdo->getSetting('alternate_nntp') == 1 ? true : false);
|
||||
$this->addpar2 = (Settings::value('..addpar2') == 0) ? false : true;
|
||||
$this->alternateNNTP = (Settings::value('..alternate_nntp') == 1 ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,7 +153,7 @@ class PostProcess
|
||||
*/
|
||||
public function processAnime()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupanidb') != 0) {
|
||||
if (Settings::value('..lookupanidb') != 0) {
|
||||
(new AniDB(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processAnimeReleases();
|
||||
}
|
||||
}
|
||||
@@ -164,7 +165,7 @@ class PostProcess
|
||||
*/
|
||||
public function processBooks()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupbooks') != 0) {
|
||||
if (Settings::value('..lookupbooks') != 0) {
|
||||
(new Books(['Echo' => $this->echooutput, 'Settings' => $this->pdo, ]))->processBookReleases();
|
||||
}
|
||||
}
|
||||
@@ -176,7 +177,7 @@ class PostProcess
|
||||
*/
|
||||
public function processConsoles()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupgames') != 0) {
|
||||
if (Settings::value('..lookupgames') != 0) {
|
||||
(new Console(['Settings' => $this->pdo, 'Echo' => $this->echooutput]))->processConsoleReleases();
|
||||
}
|
||||
}
|
||||
@@ -188,7 +189,7 @@ class PostProcess
|
||||
*/
|
||||
public function processGames()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupgames') != 0) {
|
||||
if (Settings::value('..lookupgames') != 0) {
|
||||
(new Games(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processGamesReleases();
|
||||
}
|
||||
}
|
||||
@@ -205,7 +206,7 @@ class PostProcess
|
||||
*/
|
||||
public function processMovies($groupID = '', $guidChar = '', $processMovies = '')
|
||||
{
|
||||
$processMovies = (is_numeric($processMovies) ? $processMovies : $this->pdo->getSetting('lookupimdb'));
|
||||
$processMovies = (is_numeric($processMovies) ? $processMovies : Settings::value('..lookupimdb'));
|
||||
if ($processMovies > 0) {
|
||||
(new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMovieReleases($groupID, $guidChar, $processMovies);
|
||||
}
|
||||
@@ -218,7 +219,7 @@ class PostProcess
|
||||
*/
|
||||
public function processMusic()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupmusic') != 0) {
|
||||
if (Settings::value('..lookupmusic') != 0) {
|
||||
(new Music(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processMusicReleases();
|
||||
}
|
||||
}
|
||||
@@ -234,8 +235,8 @@ class PostProcess
|
||||
*/
|
||||
public function processNfos(&$nntp, $groupID = '', $guidChar = '')
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupnfo') == 1) {
|
||||
$this->Nfo->processNfoFiles($nntp, $groupID, $guidChar, (int)$this->pdo->getSetting('lookupimdb'), (int)$this->pdo->getSetting('lookuptvrage'));
|
||||
if (Settings::value('..lookupnfo') == 1) {
|
||||
$this->Nfo->processNfoFiles($nntp, $groupID, $guidChar, (int)Settings::value('..lookupimdb'), (int)Settings::value('..lookuptvrage'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,7 +262,7 @@ class PostProcess
|
||||
*/
|
||||
public function processTv($groupID = '', $guidChar = '', $processTV = '')
|
||||
{
|
||||
$processTV = (is_numeric($processTV) ? $processTV : $this->pdo->getSetting('lookuptvrage'));
|
||||
$processTV = (is_numeric($processTV) ? $processTV : Settings::value('..lookuptvrage'));
|
||||
if ($processTV > 0) {
|
||||
(new TVDB(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processSite($groupID, $guidChar, $processTV);
|
||||
(new TVMaze(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processSite($groupID, $guidChar, $processTV);
|
||||
@@ -296,7 +297,7 @@ class PostProcess
|
||||
*/
|
||||
public function processXXX()
|
||||
{
|
||||
if ($this->pdo->getSetting('lookupxxx') == 1) {
|
||||
if (Settings::value('..lookupxxx') == 1) {
|
||||
(new XXX(['Echo' => $this->echooutput, 'Settings' => $this->pdo]))->processXXXReleases();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user