Code style fixes

This commit is contained in:
DariusIII
2024-08-13 22:13:34 +02:00
parent 48885a5d02
commit 9d3bdd1324
132 changed files with 301 additions and 301 deletions
+3 -3
View File
@@ -49,10 +49,10 @@ class Backfill
{
$this->_echoCLI = config('nntmux.echocli');
$this->_nntp = new NNTP();
$this->_binaries = new Binaries();
$this->_nntp = new NNTP;
$this->_binaries = new Binaries;
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->_compressedHeaders = (int) Settings::settingValue('..compressedheaders') === 1;
$this->_safeBackFillDate = Settings::settingValue('..safebackfilldate') !== '' ? (string) Settings::settingValue('safebackfilldate') : '2012-08-14';
+3 -3
View File
@@ -176,9 +176,9 @@ class Binaries
$this->_echoCLI = config('nntmux.echocli');
$this->_pdo = DB::connection()->getPdo();
$this->colorCli = new ColorCLI();
$this->_nntp = new NNTP();
$this->_collectionsCleaning = new CollectionsCleaning();
$this->colorCli = new ColorCLI;
$this->_nntp = new NNTP;
$this->_collectionsCleaning = new CollectionsCleaning;
$this->messageBuffer = Settings::settingValue('..maxmssgs') !== '' ?
(int) Settings::settingValue('..maxmssgs') : 20000;
+3 -3
View File
@@ -61,7 +61,7 @@ class Books
{
$this->echooutput = config('nntmux.echocli');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
@@ -127,7 +127,7 @@ class Books
%s %s %s
GROUP BY boo.id
ORDER BY %s %s %s",
(new Releases())->showPasswords(),
(new Releases)->showPasswords(),
$browseby,
$catsrch,
$exccatlist,
@@ -398,7 +398,7 @@ class Books
*/
public function updateBookInfo(string $bookInfo = '', $amazdata = null)
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$bookId = -2;
+1 -1
View File
@@ -16,7 +16,7 @@ class ColorCLI
*/
public function __construct()
{
$this->climate = new CLImate();
$this->climate = new CLImate;
}
public function debug(string $str, bool $newline = false): void
+3 -3
View File
@@ -88,7 +88,7 @@ class Console
{
$this->echooutput = config('nntmux.echocli');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
@@ -161,7 +161,7 @@ class Console
%s %s %s
GROUP BY con.id
ORDER BY %s %s %s",
(new Releases())->showPasswords(),
(new Releases)->showPasswords(),
$browseBy,
$catsrch,
$exccatlist,
@@ -564,7 +564,7 @@ class Console
*/
protected function _updateConsoleTable(array $con = [])
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$check = ConsoleInfo::query()->where('asin', $con['asin'])->first();
+3 -3
View File
@@ -82,7 +82,7 @@ class Games
{
$this->echoOutput = config('nntmux.echocli');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->publicKey = config('nntmux_api.giantbomb_api_key');
$this->gameQty = Settings::settingValue('..maxgamesprocessed') !== '' ? (int) Settings::settingValue('..maxgamesprocessed') : 150;
@@ -195,7 +195,7 @@ class Games
%s %s %s %s
GROUP BY gi.id
ORDER BY %s %s %s",
(new Releases())->showPasswords(),
(new Releases)->showPasswords(),
$browseBy,
$catsrch,
$maxAge,
@@ -343,7 +343,7 @@ class Games
//wait 10 seconds before proceeding (steam api limit)
sleep(10);
$gen = new Genres(['Settings' => null]);
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$game = [];
+3 -3
View File
@@ -130,8 +130,8 @@ class IRCScraper extends IRCClient
$this->_titleIgnoreRegex = config('irc_settings.scrape_irc_title_ignore');
}
$this->elasticsearch = new ElasticSearchSiteSearch();
$this->manticoreSearch = new ManticoreSearch();
$this->elasticsearch = new ElasticSearchSiteSearch;
$this->manticoreSearch = new ManticoreSearch;
$this->_groupList = [];
$this->_silent = $silent;
@@ -284,7 +284,7 @@ class IRCScraper extends IRCClient
protected function _insertNewPre(): void
{
if (config('nntmux.elasticsearch_enabled') === true) {
$indexData = (new ElasticSearchSiteSearch())->predbIndexSearch($this->_curPre['title']);
$indexData = (new ElasticSearchSiteSearch)->predbIndexSearch($this->_curPre['title']);
} else {
$indexData = $this->manticoreSearch->searchIndexes('predb_rt', $this->_curPre['title'], ['title']);
}
+1 -1
View File
@@ -39,7 +39,7 @@ class ManticoreSearch
$this->connection = ['host' => $this->config['host'], 'port' => $this->config['port']];
$this->manticoresearch = new Client($this->connection);
$this->search = new Search($this->manticoresearch);
$this->cli = new ColorCLI();
$this->cli = new ColorCLI;
}
/**
+5 -5
View File
@@ -116,13 +116,13 @@ class Movie
public function __construct()
{
$this->releaseImage = new ReleaseImage();
$this->colorCli = new ColorCLI();
$this->releaseImage = new ReleaseImage;
$this->colorCli = new ColorCLI;
$this->traktcheck = config('nntmux_api.trakttv_api_key');
if ($this->traktcheck !== null) {
$this->traktTv = new TraktTv(['Settings' => null]);
}
$this->client = new Client();
$this->client = new Client;
$this->fanartapikey = config('nntmux_api.fanarttv_api_key');
if ($this->fanartapikey !== null) {
$this->fanart = new FanartTV($this->fanartapikey);
@@ -133,7 +133,7 @@ class Movie
}
$this->lookuplanguage = Settings::settingValue('indexer.categorise.imdblanguage') !== '' ? (string) Settings::settingValue('indexer.categorise.imdblanguage') : 'en';
$this->config = new Config();
$this->config = new Config;
$this->config->language = $this->lookuplanguage;
$this->config->throwHttpExceptions = false;
$cacheDir = storage_path('framework/cache/imdb_cache');
@@ -144,7 +144,7 @@ class Movie
$this->imdburl = (int) Settings::settingValue('indexer.categorise.imdburl') !== 0;
$this->movieqty = Settings::settingValue('..maximdbprocessed') !== '' ? (int) Settings::settingValue('..maximdbprocessed') : 100;
$this->showPasswords = (new Releases())->showPasswords();
$this->showPasswords = (new Releases)->showPasswords();
$this->echooutput = config('nntmux.echocli');
$this->imgSavePath = storage_path('covers/movies/');
+4 -4
View File
@@ -78,7 +78,7 @@ class Music
{
$this->echooutput = config('nntmux.echocli');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->pubkey = Settings::settingValue('APIs..amazonpubkey');
$this->privkey = Settings::settingValue('APIs..amazonprivkey');
@@ -153,7 +153,7 @@ class Music
%s %s %s
GROUP BY m.id
ORDER BY %s %s %s",
(new Releases())->showPasswords(),
(new Releases)->showPasswords(),
$browseby,
$catsrch,
$exccatlist,
@@ -300,7 +300,7 @@ class Music
*/
public function updateMusicInfo($title, $year, $amazdata = null)
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$mus = [];
if ($amazdata !== null) {
@@ -612,7 +612,7 @@ class Music
{
$mus = true;
// Load genres.
$defaultGenres = (new Genres())->loadGenres(Genres::MUSIC_TYPE);
$defaultGenres = (new Genres)->loadGenres(Genres::MUSIC_TYPE);
try {
$album = iTunes::load('album')->fetchOneByName($title);
+1 -1
View File
@@ -93,7 +93,7 @@ class NZB
return false;
}
$XMLWriter = new \XMLWriter();
$XMLWriter = new \XMLWriter;
$XMLWriter->openMemory();
$XMLWriter->setIndent(true);
$XMLWriter->setIndentString(' ');
+4 -4
View File
@@ -36,10 +36,10 @@ class NZBContents
{
$this->echooutput = config('nntmux.echocli');
$this->nntp = new NNTP();
$this->nfo = new Nfo();
$this->pp = new PostProcess();
$this->nzb = new NZB();
$this->nntp = new NNTP;
$this->nfo = new Nfo;
$this->pp = new PostProcess;
$this->nzb = new NZB;
$this->lookuppar2 = (int) Settings::settingValue('..lookuppar2') === 1;
$this->alternateNNTP = (int) Settings::settingValue('..alternate_nntp') === 1;
}
+2 -2
View File
@@ -31,8 +31,8 @@ class NZBExport
public function __construct()
{
$this->echoCLI = config('nntmux.echocli');
$this->releases = new Releases();
$this->nzb = new NZB();
$this->releases = new Releases;
$this->nzb = new NZB;
}
/**
+5 -5
View File
@@ -65,11 +65,11 @@ class NZBImport
public function __construct(array $options = [])
{
$this->echoCLI = config('nntmux.echocli');
$this->binaries = new Binaries();
$this->category = new Categorize();
$this->nzb = new NZB();
$this->releaseCleaner = new ReleaseCleaning();
$this->colorCli = new ColorCLI();
$this->binaries = new Binaries;
$this->category = new Categorize;
$this->nzb = new NZB;
$this->releaseCleaner = new ReleaseCleaning;
$this->colorCli = new ColorCLI;
$this->crossPostt = Settings::settingValue('..crossposttime') !== '' ? Settings::settingValue('..crossposttime') : 2;
// Set properties from options
+11 -11
View File
@@ -130,10 +130,10 @@ class NameFixer
$this->fullall = '';
$this->_fileName = '';
$this->done = $this->matched = false;
$this->colorCLI = new ColorCLI();
$this->category = new Categorize();
$this->manticore = new ManticoreSearch();
$this->elasticsearch = new ElasticSearchSiteSearch();
$this->colorCLI = new ColorCLI;
$this->category = new Categorize;
$this->manticore = new ManticoreSearch;
$this->elasticsearch = new ElasticSearchSiteSearch;
}
/**
@@ -507,8 +507,8 @@ class NameFixer
$this->_totalReleases = $total;
$this->colorCLI->climate()->info(number_format($total).' releases to process.');
$Nfo = new Nfo();
$nzbContents = new NZBContents();
$Nfo = new Nfo;
$nzbContents = new NZBContents;
foreach ($releases as $release) {
if ($nzbContents->checkPAR2($release->guid, $release->releases_id, $release->groups_id, $nameStatus, $show)) {
@@ -792,7 +792,7 @@ class NameFixer
'Renamed Releases: ['.
number_format($this->fixed).
'] '.
(new ConsoleTools())->percentString($this->checked, $this->_totalReleases)
(new ConsoleTools)->percentString($this->checked, $this->_totalReleases)
);
}
}
@@ -814,7 +814,7 @@ class NameFixer
$release->releases_id = $release->id;
}
if ($this->relid !== $release->releases_id) {
$newName = (new ReleaseCleaning())->fixerCleaner($name);
$newName = (new ReleaseCleaning)->fixerCleaner($name);
if (strtolower($newName) !== strtolower($release->searchname)) {
$this->matched = true;
$this->relid = (int) $release->releases_id;
@@ -990,7 +990,7 @@ class NameFixer
'method' => '',
]
): void {
$colorCLI = new ColorCLI();
$colorCLI = new ColorCLI;
echo PHP_EOL;
$colorCLI->info('New name: ').$colorCLI->primaryOver($data['new_name']).
@@ -1122,7 +1122,7 @@ class NameFixer
$counted++;
}
if ($show === 0) {
$this->colorCLI->climate()->info('Renamed Releases: ['.number_format($counted).'] '.(new ConsoleTools())->percentString(++$counter, $total));
$this->colorCLI->climate()->info('Renamed Releases: ['.number_format($counted).'] '.(new ConsoleTools)->percentString(++$counter, $total));
}
}
$this->colorCLI->climate()->info(PHP_EOL.'Renamed '.number_format($counted).' releases in '.now()->diffInSeconds($timeStart, true).' seconds'.'.');
@@ -1294,7 +1294,7 @@ class NameFixer
$updated += $this->matchPredbHash($hits[0], $row, $echo, $nameStatus, $show);
}
if ($show === 2) {
$this->colorCLI->climate()->info('Renamed Releases: ['.number_format($updated).'] '.(new ConsoleTools())->percentString($checked++, $total));
$this->colorCLI->climate()->info('Renamed Releases: ['.number_format($updated).'] '.(new ConsoleTools)->percentString($checked++, $total));
}
}
if ($echo === 1) {
+3 -3
View File
@@ -72,7 +72,7 @@ class Nfo
$this->maxRetries = $this->maxRetries < -8 ? -8 : $this->maxRetries;
$this->maxSize = (int) Settings::settingValue('..maxsizetoprocessnfo');
$this->minSize = (int) Settings::settingValue('..minsizetoprocessnfo');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->tmpPath = config('nntmux.tmp_unrar_path');
if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
@@ -164,11 +164,11 @@ class Nfo
}
// Check if it's a par2.
$par2info = new Par2Info();
$par2info = new Par2Info;
$par2info->setData($possibleNFO);
if ($par2info->error) {
// Check if it's an SFV.
$sfv = new SfvInfo();
$sfv = new SfvInfo;
$sfv->setData($possibleNFO);
if ($sfv->error) {
return true;
+2 -2
View File
@@ -52,7 +52,7 @@ class PopulateAniDB
public function __construct()
{
$this->echooutput = config('nntmux.echocli');
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency');
$lastupdated = Settings::settingValue('APIs.AniDB.last_full_update');
@@ -430,7 +430,7 @@ class PopulateAniDB
}
if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) {
(new ReleaseImage())->saveImage(
(new ReleaseImage)->saveImage(
$aniDbId,
'http://img7.anidb.net/pics/anime/'.$picture,
$this->imgSavePath
+1 -1
View File
@@ -48,7 +48,7 @@ class ReleaseImage
*/
public function __construct()
{
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->audSavePath = storage_path('covers/audiosample/');
$this->imgSavePath = storage_path('covers/preview/');
$this->jpgSavePath = storage_path('covers/sample/');
+6 -6
View File
@@ -58,10 +58,10 @@ class ReleaseRemover
public function __construct()
{
$this->colorCLI = new ColorCLI();
$this->releases = new Releases();
$this->nzb = new NZB();
$this->releaseImage = new ReleaseImage();
$this->colorCLI = new ColorCLI;
$this->releases = new Releases;
$this->nzb = new NZB;
$this->releaseImage = new ReleaseImage;
$this->query = '';
$this->error = '';
@@ -724,9 +724,9 @@ class ReleaseRemover
if ($opTypeName === 'Subject') {
if (config('nntmux.elasticsearch_enabled') === true) {
$searchResult = (new ElasticSearchSiteSearch())->indexSearch($regexMatch, 100);
$searchResult = (new ElasticSearchSiteSearch)->indexSearch($regexMatch, 100);
} else {
$searchResult = (new ManticoreSearch())->searchIndexes('releases_rt', $regexMatch, ['name,searchname']);
$searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $regexMatch, ['name,searchname']);
if (! empty($searchResult)) {
$searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
}
+4 -4
View File
@@ -38,8 +38,8 @@ class Releases extends Release
public function __construct()
{
parent::__construct();
$this->manticoreSearch = new ManticoreSearch();
$this->elasticSearch = new ElasticSearchSiteSearch();
$this->manticoreSearch = new ManticoreSearch;
$this->elasticSearch = new ElasticSearchSiteSearch;
}
/**
@@ -325,8 +325,8 @@ class Releases extends Release
{
$list = (array) $list;
$nzb = new NZB();
$releaseImage = new ReleaseImage();
$nzb = new NZB;
$releaseImage = new ReleaseImage;
foreach ($list as $identifier) {
$this->deleteSingle(['g' => $identifier, 'i' => false], $nzb, $releaseImage);
+2 -2
View File
@@ -46,7 +46,7 @@ class Steam
]
);
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
}
/**
@@ -135,7 +135,7 @@ class Steam
*/
public function populateSteamAppsTable(): void
{
$bar = new ProgressBar();
$bar = new ProgressBar;
$lastUpdate = Settings::settingValue('APIs.Steam.last_update');
$this->lastUpdate = $lastUpdate > 0 ? $lastUpdate : 0;
if ((time() - (int) $this->lastUpdate) > 86400) {
+1 -1
View File
@@ -27,7 +27,7 @@ class Tmux
public function __construct()
{
$this->pdo = DB::connection()->getPdo();
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
}
/**
+7 -7
View File
@@ -46,11 +46,11 @@ class XXX
public function __construct()
{
$this->releaseImage = new ReleaseImage();
$this->colorCli = new ColorCLI();
$this->releaseImage = new ReleaseImage;
$this->colorCli = new ColorCLI;
$this->movieQty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100;
$this->showPasswords = (new Releases())->showPasswords();
$this->showPasswords = (new Releases)->showPasswords();
$this->echoOutput = config('nntmux.echocli');
$this->imgSavePath = storage_path('covers/xxx/');
$this->cookie = resource_path('tmp/xxx.cookie');
@@ -369,7 +369,7 @@ class XXX
$cover = $backdrop = 0;
$xxxID = -2;
$this->whichClass = 'aebn';
$mov = new AEBN();
$mov = new AEBN;
$mov->cookie = $this->cookie;
$this->colorCli->info('Checking AEBN for movie info');
$res = $mov->processSite($movie);
@@ -384,7 +384,7 @@ class XXX
if ($res === false) {
$this->whichClass = 'adm';
$mov = new ADM();
$mov = new ADM;
$mov->cookie = $this->cookie;
$this->colorCli->info('Checking ADM for movie info');
$res = $mov->processSite($movie);
@@ -392,14 +392,14 @@ class XXX
if ($res === false) {
$this->whichClass = 'ade';
$mov = new ADE();
$mov = new ADE;
$this->colorCli->info('Checking ADE for movie info');
$res = $mov->processSite($movie);
}
if ($res === false) {
$this->whichClass = 'hotm';
$mov = new Hotmovies();
$mov = new Hotmovies;
$mov->cookie = $this->cookie;
$this->colorCli->info('Checking HotMovies for movie info');
$res = $mov->processSite($movie);
+2 -2
View File
@@ -93,7 +93,7 @@ class Forking
public function __construct()
{
SerializableClosure::removeSecurityProvider();
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->dnr_path = PHP_BINARY.' misc/update/multiprocessing/.do_not_run/switch.php "php ';
@@ -851,7 +851,7 @@ class Forking
{
$sharing = DB::select('SELECT enabled FROM sharing');
if ($sharing > 0 && (int) $sharing[0]->enabled === 1) {
$nntp = new NNTP();
$nntp = new NNTP;
if ((int) (Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) === true) {
(new PostProcess(['ColorCLI' => $this->colorCli]))->processSharing($nntp);
}
+1 -1
View File
@@ -41,7 +41,7 @@ class TraktAPI
}
$this->requestHeaders = $headers;
$this->client = new Client();
$this->client = new Client;
}
/**
+3 -3
View File
@@ -54,9 +54,9 @@ class PostProcess
$this->echooutput = config('nntmux.echocli');
// Class instances.
$this->_par2Info = new Par2Info();
$this->nameFixer = new NameFixer();
$this->Nfo = new Nfo();
$this->_par2Info = new Par2Info;
$this->nameFixer = new NameFixer;
$this->Nfo = new Nfo;
// Site settings.
$this->addpar2 = (int) Settings::settingValue('..addpar2') !== 0;
+8 -8
View File
@@ -76,11 +76,11 @@ class ProcessReleases
{
$this->echoCLI = config('nntmux.echocli');
$this->colorCLI = new ColorCLI();
$this->nzb = new NZB();
$this->releaseCleaning = new ReleaseCleaning();
$this->releases = new Releases();
$this->releaseImage = new ReleaseImage();
$this->colorCLI = new ColorCLI;
$this->nzb = new NZB;
$this->releaseCleaning = new ReleaseCleaning;
$this->releases = new Releases;
$this->releaseImage = new ReleaseImage;
$dummy = Settings::settingValue('..delaytime');
$this->collectionDelayTime = ($dummy !== '' ? (int) $dummy : 2);
@@ -178,7 +178,7 @@ class ProcessReleases
*/
public function categorizeRelease(string $type, $groupId): int
{
$cat = new Categorize();
$cat = new Categorize;
$categorized = $total = 0;
$releasesQuery = Release::query()->where(['categories_id' => Category::OTHER_MISC, 'iscategorized' => 0]);
if (! empty($groupId)) {
@@ -384,7 +384,7 @@ class ProcessReleases
{
$startTime = now()->toImmutable();
$categorize = new Categorize();
$categorize = new Categorize;
$returnCount = $duplicate = 0;
if ($this->echoCLI) {
@@ -809,7 +809,7 @@ class ProcessReleases
public function deleteReleases(): void
{
$startTime = now()->toImmutable();
$genres = new Genres();
$genres = new Genres;
$passwordDeleted = $duplicateDeleted = $retentionDeleted = $completionDeleted = $disabledCategoryDeleted = 0;
$disabledGenreDeleted = $miscRetentionDeleted = $miscHashedDeleted = $categoryMinSizeDeleted = 0;
+1 -1
View File
@@ -17,7 +17,7 @@ abstract class AdultMovies
*/
public function __construct()
{
$this->_html = new HtmlDomParser();
$this->_html = new HtmlDomParser;
}
/**
+2 -2
View File
@@ -43,8 +43,8 @@ class AniDB
public function __construct()
{
$this->echooutput = config('nntmux.echocli');
$this->padb = new PaDb();
$this->colorCli = new ColorCLI();
$this->padb = new PaDb;
$this->colorCli = new ColorCLI;
$quantity = (int) Settings::settingValue('..maxanidbprocessed');
$this->aniqty = $quantity ?? 100;
@@ -259,21 +259,21 @@ class ProcessAdditional
{
$this->_echoCLI = config('nntmux.echocli');
$this->_nntp = new NNTP();
$this->_nntp = new NNTP;
$this->_nzb = new NZB();
$this->_archiveInfo = new ArchiveInfo();
$this->_categorize = new Categorize();
$this->_nameFixer = new NameFixer();
$this->_releaseExtra = new ReleaseExtra();
$this->_releaseImage = new ReleaseImage();
$this->_par2Info = new Par2Info();
$this->_nfo = new Nfo();
$this->manticore = new ManticoreSearch();
$this->elasticsearch = new ElasticSearchSiteSearch();
$this->_nzb = new NZB;
$this->_archiveInfo = new ArchiveInfo;
$this->_categorize = new Categorize;
$this->_nameFixer = new NameFixer;
$this->_releaseExtra = new ReleaseExtra;
$this->_releaseImage = new ReleaseImage;
$this->_par2Info = new Par2Info;
$this->_nfo = new Nfo;
$this->manticore = new ManticoreSearch;
$this->elasticsearch = new ElasticSearchSiteSearch;
$this->ffmpeg = FFMpeg::create(['timeout' => Settings::settingValue('..timeoutseconds')]);
$this->ffprobe = FFProbe::create();
$this->mediaInfo = new MediaInfo();
$this->mediaInfo = new MediaInfo;
$this->mediaInfo->setConfig('use_oldxml_mediainfo_output_format', true);
$this->mediaInfo->setConfig('command', Settings::settingValue('apps..mediainfopath'));
@@ -894,14 +894,14 @@ class ProcessAdditional
if (preg_match(NameFixer::PREDB_REGEX, $rarFileName[0], $hit)) {
$preCheck = Predb::whereTitle($hit[0])->first();
$this->_release->preid = $preCheck !== null ? $preCheck->value('id') : 0;
(new NameFixer())->updateRelease($this->_release, $preCheck->title ?? ucwords($hit[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid);
(new NameFixer)->updateRelease($this->_release, $preCheck->title ?? ucwords($hit[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid);
} elseif (! empty($dataSummary['archives']) && ! empty($dataSummary['archives'][$rarFileName[0]]['file_list'])) {
$archiveData = $dataSummary['archives'][$rarFileName[0]]['file_list'];
$archiveFileName = Arr::pluck($archiveData, 'name');
if (preg_match(NameFixer::PREDB_REGEX, $archiveFileName[0], $match2)) {
$preCheck = Predb::whereTitle($match2[0])->first();
$this->_release->preid = $preCheck !== null ? $preCheck->value('id') : 0;
(new NameFixer())->updateRelease($this->_release, $preCheck->title ?? ucwords($match2[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid);
(new NameFixer)->updateRelease($this->_release, $preCheck->title ?? ucwords($match2[0], '.'), 'RarInfo FileName Match', true, 'Filenames, ', true, true, $this->_release->preid);
}
}
}
@@ -1572,7 +1572,7 @@ class ProcessAdditional
if ($this->ffprobe->isValid($fileLocation)) {
try {
$audioSample = $this->ffmpeg->open($fileLocation);
$format = new Vorbis();
$format = new Vorbis;
$audioSample->clip(TimeCode::fromSeconds(30), TimeCode::fromSeconds(30));
$audioSample->save($format, $this->tmpPath.$audioFileName);
} catch (\InvalidArgumentException $e) {
@@ -1774,7 +1774,7 @@ class ProcessAdditional
try {
$video = $this->ffmpeg->open($fileLocation);
$videoSample = $video->clip(TimeCode::fromString($lowestLength), TimeCode::fromSeconds($this->_ffMPEGDuration));
$format = new Ogg();
$format = new Ogg;
$format->setAudioCodec('libvorbis');
$videoSample->filters()->resize(new Dimension(320, -1), ResizeFilter::RESIZEMODE_SCALE_HEIGHT);
$videoSample->save($format, $fileName);
@@ -1793,7 +1793,7 @@ class ProcessAdditional
try {
$video = $this->ffmpeg->open($fileLocation);
$videoSample = $video->clip(TimeCode::fromSeconds(0), TimeCode::fromSeconds($this->_ffMPEGDuration));
$format = new Ogg();
$format = new Ogg;
$format->setAudioCodec('libvorbis');
$videoSample->filters()->resize(new Dimension(320, -1), ResizeFilter::RESIZEMODE_SCALE_HEIGHT);
$videoSample->save($format, $fileName);
@@ -2085,7 +2085,7 @@ class ProcessAdditional
protected function _echo(string $string, string $type): void
{
if ($this->_echoCLI) {
(new ColorCLI())->$type($string);
(new ColorCLI)->$type($string);
}
}
+1 -1
View File
@@ -259,7 +259,7 @@ class TMDB extends TV
*/
public function getPoster(int $videoId): int
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$hascover = 0;
+1 -1
View File
@@ -78,7 +78,7 @@ abstract class TV extends Videos
public function __construct()
{
parent::__construct();
$this->colorCli = new ColorCLI();
$this->colorCli = new ColorCLI;
$this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME;
$this->tvqty = Settings::settingValue('..maxrageprocessed') !== '' ? (int) Settings::settingValue('..maxrageprocessed') : 75;
$this->imgSavePath = storage_path('covers/tvshows/');
+2 -2
View File
@@ -47,7 +47,7 @@ class TVDB extends TV
public function __construct()
{
parent::__construct();
$this->client = new TheTVDbAPI();
$this->client = new TheTVDbAPI;
$this->local = false;
$this->authorizeTvdb();
@@ -277,7 +277,7 @@ class TVDB extends TV
*/
public function getPoster(int $videoId): int
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
// Try to get the Poster
$hasCover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath);
+2 -2
View File
@@ -33,7 +33,7 @@ class TVMaze extends TV
public function __construct()
{
parent::__construct();
$this->client = new Client();
$this->client = new Client;
}
/**
@@ -290,7 +290,7 @@ class TVMaze extends TV
*/
public function getPoster(int $videoId): int
{
$ri = new ReleaseImage();
$ri = new ReleaseImage;
$hasCover = 0;
+1 -1
View File
@@ -212,7 +212,7 @@ class TraktTv extends TV
public function getPoster(int $videoId): int
{
$hasCover = 0;
$ri = new ReleaseImage();
$ri = new ReleaseImage;
if ($this->posterUrl !== '') {
// Try to get the Poster
+4 -4
View File
@@ -52,7 +52,7 @@ class CleanNZB extends Command
private function GetNZBsWithNoDatabaseEntry($delete = false)
{
$this->info('Getting list of NZB files on disk to check if they exist in database');
$releases = new Release();
$releases = new Release;
$checked = $deleted = 0;
// Get the list of NZBs in the NZB folder
$dirItr = new \RecursiveDirectoryIterator(Settings::settingValue('..nzbpath'));
@@ -80,8 +80,8 @@ class CleanNZB extends Command
private function GetReleasesWithNoNZBOnDisk($delete = false)
{
// Setup
$nzb = new NZB();
$rel = new Releases();
$nzb = new NZB;
$rel = new Releases;
$checked = $deleted = 0;
$this->info('Getting list of releases from database to check if they have a corresponding NZB on disk');
@@ -94,7 +94,7 @@ class CleanNZB extends Command
if (! $nzb->NZBPath($r->guid)) {
if ($delete) {
$rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage());
$rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage);
}
$deleted++;
$this->line("Deleted: $r->searchname -> $r->guid");
+2 -2
View File
@@ -53,7 +53,7 @@ class ImportNzbs extends Command
if (empty($folders)) {
$this->info('Importing NZB files from '.$importFolder);
$files = File::allFiles($importFolder);
$NZBImport = new NZBImport();
$NZBImport = new NZBImport;
try {
$NZBImport->beginImport($files, $useNzbName, $deleteNZB, $deleteFailedNZB);
@@ -64,7 +64,7 @@ class ImportNzbs extends Command
foreach ($folders as $folder) {
$this->info('Importing NZB files from '.$folder);
$files = File::allFiles($folder);
$NZBImport = new NZBImport();
$NZBImport = new NZBImport;
try {
$NZBImport->beginImport($files, $useNzbName, $deleteNZB, $deleteFailedNZB);
@@ -60,7 +60,7 @@ class NntmuxPopulateSearchIndexes extends Command
*/
private function manticoreReleases(): void
{
$manticore = new ManticoreSearch();
$manticore = new ManticoreSearch;
$manticore->truncateRTIndex(Arr::wrap('releases_rt'));
$data = [];
$total = Release::count();
@@ -107,7 +107,7 @@ class NntmuxPopulateSearchIndexes extends Command
*/
private function manticorePreDB(): void
{
$manticore = new ManticoreSearch();
$manticore = new ManticoreSearch;
$manticore->truncateRTIndex(['predb_rt']);
$data = [];
@@ -149,7 +149,7 @@ class NntmuxPopulateSearchIndexes extends Command
private function elasticReleases(): void
{
$data = ['body' => []];
$elastic = new ElasticSearchSiteSearch();
$elastic = new ElasticSearchSiteSearch;
$total = Release::count();
if (! $total) {
$this->warn('Could not get database information for releases table.');
@@ -200,7 +200,7 @@ class NntmuxPopulateSearchIndexes extends Command
private function elasticPreDB(): void
{
$data = ['body' => []];
$elastic = new ElasticSearchSiteSearch();
$elastic = new ElasticSearchSiteSearch;
$total = Predb::count();
if (! $total) {
$this->warn('Could not get database information for predb table.');
@@ -250,7 +250,7 @@ class NntmuxPopulateSearchIndexes extends Command
{
$this->info('Optimizing release_rt & predb_rt indexes');
try {
(new ManticoreSearch())->optimizeRTIndex();
(new ManticoreSearch)->optimizeRTIndex();
} catch (\Exception $e) {
echo $e->getMessage();
}
+1 -1
View File
@@ -26,7 +26,7 @@ class NntmuxPopulateSteam extends Command
*/
public function handle(): void
{
$steam = new Steam();
$steam = new Steam;
$steam->populateSteamAppsTable();
}
@@ -27,7 +27,7 @@ class NntmuxPopulateSteamApps extends Command
public function handle(): void
{
try {
(new Steam())->populateSteamAppsTable();
(new Steam)->populateSteamAppsTable();
} catch (\Exception $e) {
$this->error($e->getMessage());
$this->error('There was an error populating the steam_apps table');
@@ -49,7 +49,7 @@ class NntmuxRemoveBadReleases extends Command
// Select releases with password status -2 and smaller and delete them. Also delete the files from the filesystem.
$badReleases = Release::query()->where('passwordstatus', '<=', -2)->get();
foreach ($badReleases as $badRelease) {
$nzbPath = (new NZB())->getNZBPath($badRelease->guid);
$nzbPath = (new NZB)->getNZBPath($badRelease->guid);
File::delete($nzbPath);
(new ReleaseImage)->delete($badRelease->guid);
if (config('nntmux.elasticsearch_enabled') === true) {
@@ -68,7 +68,7 @@ class NntmuxRemoveBadReleases extends Command
'i' => $badRelease->id,
];
// Delete from sphinx.
(new ManticoreSearch())->deleteRelease($identifiers);
(new ManticoreSearch)->deleteRelease($identifiers);
}
$badRelease->delete();
}
+1 -1
View File
@@ -172,7 +172,7 @@ class NntmuxResetDb extends Command
$this->info('All done! ElasticSearch indexes are deleted and recreated.');
} else {
(new ManticoreSearch())->truncateRTIndex(['releases_rt', 'predb_rt']);
(new ManticoreSearch)->truncateRTIndex(['releases_rt', 'predb_rt']);
}
$this->info('Deleting nzbfiles subfolders.');
@@ -58,7 +58,7 @@ class RecategorizeReleases extends Command
$count = $countQuery->count();
$cat = new Categorize();
$cat = new Categorize;
$results = $countQuery->select(['id', 'searchname', 'fromname', 'groups_id', 'categories_id'])->get();
$bar = $this->output->createProgressBar($count);
$bar->start();
+1 -1
View File
@@ -28,7 +28,7 @@ class TmuxUIStart extends Command
*/
public function handle(): void
{
$tmux = new Tmux();
$tmux = new Tmux;
$tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0;
// Set running value to on.
+1 -1
View File
@@ -28,7 +28,7 @@ class TmuxUIStop extends Command
*/
public function handle(): void
{
$tmux = new Tmux();
$tmux = new Tmux;
$tmux->stopIfRunning();
if ($this->option('kill') === true) {
$sessionName = Settings::settingValue('site.tmux.tmux_session');
+2 -2
View File
@@ -76,7 +76,7 @@ class UpdateNNTmux extends Command
echo $process->errorOutput();
$this->info('Assets built successfully!');
$cleared = (new Smarty())->setCompileDir(config('ytake-laravel-smarty.compile_path'))->clearCompiledTemplate();
$cleared = (new Smarty)->setCompileDir(config('ytake-laravel-smarty.compile_path'))->clearCompiledTemplate();
if ($cleared) {
$this->output->writeln('<comment>The Smarty compiled template cache has been cleaned for you</comment>');
} else {
@@ -107,7 +107,7 @@ class UpdateNNTmux extends Command
private function stopTmux(): bool
{
if ((new Tmux())->isRunning() === true) {
if ((new Tmux)->isRunning() === true) {
$this->call('tmux-ui:stop', ['--kill' => true]);
return true;
+1 -1
View File
@@ -34,7 +34,7 @@ class UpdateNNTmuxGit extends Command
{
$wasRunning = false;
if ((new Tmux())->isRunning()) {
if ((new Tmux)->isRunning()) {
$wasRunning = true;
$this->call('tmux-ui:stop', ['--kill' => true]);
}
+3 -3
View File
@@ -23,7 +23,7 @@ if (! function_exists('getRawHtml')) {
*/
function getRawHtml($url, $cookie = false)
{
$cookieJar = new CookieJar();
$cookieJar = new CookieJar;
$client = new Client(['headers' => ['User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246']]);
if ($cookie !== false) {
$cookie = $cookieJar->setCookie(SetCookie::fromString($cookie));
@@ -67,7 +67,7 @@ if (! function_exists('makeFieldLinks')) {
continue;
}
if ($type === 'xxx' && $field === 'genre') {
$ta = (new XXX())->getGenres(true, $ta);
$ta = (new XXX)->getGenres(true, $ta);
$ta = $ta['title'] ?? '';
}
if ($i > 7) {
@@ -272,7 +272,7 @@ if (! function_exists('is_it_json')) {
*/
function getStreamingZip(array $guids = []): STS\ZipStream\ZipStream
{
$nzb = new NZB();
$nzb = new NZB;
$zipped = ZipStream::create(now()->format('Ymdhis').'.zip');
foreach ($guids as $guid) {
$nzbPath = $nzb->NZBPath($guid);
@@ -16,7 +16,7 @@ class AdminAnidbController extends BasePageController
{
$this->setAdminPrefs();
$AniDB = new AniDB();
$AniDB = new AniDB;
$title = $meta_title = 'AniDB List';
$aname = '';
@@ -43,7 +43,7 @@ class AdminAnidbController extends BasePageController
{
$this->setAdminPrefs();
$AniDB = new AniDB();
$AniDB = new AniDB;
// Set the current action.
$action = $request->input('action') ?? 'view';
@@ -15,7 +15,7 @@ class AdminBlacklistController extends BasePageController
public function index(): void
{
$this->setAdminPrefs();
$binaries = new Binaries();
$binaries = new Binaries;
$meta_title = $title = 'Binary Black/White List';
@@ -38,7 +38,7 @@ class AdminBookController extends BasePageController
public function edit(Request $request)
{
$this->setAdminPrefs();
$book = new Books();
$book = new Books;
$meta_title = $title = 'Book Edit';
@@ -39,7 +39,7 @@ class AdminConsoleController extends BasePageController
{
$this->setAdminPrefs();
$console = new Console(['Settings' => null]);
$gen = new Genres();
$gen = new Genres;
$meta_title = $title = 'Console Edit';
// set the current action
@@ -16,7 +16,7 @@ class AdminContentController extends BasePageController
public function index(): void
{
$this->setAdminPrefs();
$contentList = (new Contents())->getAll();
$contentList = (new Contents)->getAll();
$this->smarty->assign('contentlist', $contentList);
$meta_title = 'Content List';
@@ -36,7 +36,7 @@ class AdminContentController extends BasePageController
public function create(Request $request)
{
$this->setAdminPrefs();
$contents = new Contents();
$contents = new Contents;
$meta_title = 'Content Add';
// Set the current action.
@@ -110,7 +110,7 @@ class AdminContentController extends BasePageController
public function destroy(Request $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
{
if ($request->has('id')) {
$contents = new Contents();
$contents = new Contents;
$contents->delete($request->input('id'));
}
@@ -86,7 +86,7 @@ class AdminMovieController extends BasePageController
{
$this->setAdminPrefs();
$movie = new Movie();
$movie = new Movie;
$meta_title = $title = 'Add Movie';
// set the current action
@@ -36,8 +36,8 @@ class AdminMusicController extends BasePageController
public function edit(Request $request)
{
$this->setAdminPrefs();
$music = new Music();
$gen = new Genres();
$music = new Music;
$gen = new Genres;
$meta_title = $title = 'Music Edit';
@@ -71,7 +71,7 @@ class AdminNzbController extends BasePageController
public function export(Request $request): void
{
$this->setAdminPrefs();
$rel = new Releases();
$rel = new Releases;
if ($this->isPostBack($request)) {
$path = $request->input('folder');
@@ -93,7 +93,7 @@ class AdminReleasesController extends BasePageController
public function destroy($id): RedirectResponse
{
if ($id) {
$releases = new Releases();
$releases = new Releases;
$releases->deleteMultiple($id);
}
+1 -1
View File
@@ -15,7 +15,7 @@ class AdultController extends BasePageController
public function show(Request $request, string $id = ''): void
{
$this->setPreferences();
$adult = new XXX();
$adult = new XXX;
$moviecats = Category::getChildren(Category::XXX_ROOT);
$mtmp = [];
+2 -2
View File
@@ -27,8 +27,8 @@ class AnimeController extends BasePageController
public function __construct()
{
parent::__construct();
$this->aniDb = new AniDB();
$this->releases = new Releases();
$this->aniDb = new AniDB;
$this->releases = new Releases;
}
/**
+1 -1
View File
@@ -114,7 +114,7 @@ class ApiController extends BasePageController
}
}
$releases = new Releases();
$releases = new Releases;
// Set Query Parameters based on Request objects
$outputXML = ! ($request->has('o') && $request->input('o') === 'json');
@@ -31,7 +31,7 @@ class ApiInformController extends Controller
ReleaseInform::insertOrIgnore(['relOName' => $releaseObName, 'relPName' => $releasePrName, 'api_token' => $apiToken, 'created_at' => now(), 'updated_at' => now()]);
$release = Release::whereSearchname($releaseObName)->first();
if (! empty($release)) {
(new NameFixer())->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true);
(new NameFixer)->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true);
}
return response()->json(['message' => 'Release Information Added!'], 200);
+5 -5
View File
@@ -25,7 +25,7 @@ class ApiV2Controller extends BasePageController
public function __construct()
{
$this->api = new ApiController();
$this->api = new ApiController;
}
public function capabilities(): JsonResponse
@@ -53,7 +53,7 @@ class ApiV2Controller extends BasePageController
'movie-search' => ['available' => 'yes', 'supportedParams' => 'id, imdbid, tmdbid, traktid'],
'audio-search' => ['available' => 'no', 'supportedParams' => ''],
],
'categories' => fractal($category, new CategoryTransformer()),
'categories' => fractal($category, new CategoryTransformer),
];
return response()->json($capabilities);
@@ -67,7 +67,7 @@ class ApiV2Controller extends BasePageController
if ($request->missing('api_token') || ($request->has('api_token') && $request->isNotFilled('api_token'))) {
return response()->json(['error' => 'Missing parameter (apikey)'], 403);
}
$releases = new Releases();
$releases = new Releases;
$user = User::query()->where('api_token', $request->input('api_token'))->first();
$minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0;
$maxAge = $this->api->maxAge($request);
@@ -120,7 +120,7 @@ class ApiV2Controller extends BasePageController
if ($request->missing('api_token') || $request->isNotFilled('api_token')) {
return response()->json(['error' => 'Missing parameter (api_token)'], 403);
}
$releases = new Releases();
$releases = new Releases;
$user = User::query()->where('api_token', $request->input('api_token'))->first();
$offset = $this->api->offset($request);
$catExclusions = User::getCategoryExclusionForApi($request);
@@ -185,7 +185,7 @@ class ApiV2Controller extends BasePageController
if ($request->missing('api_token') || $request->isNotFilled('api_token')) {
return response()->json(['error' => 'Missing parameter (api_token)'], 403);
}
$releases = new Releases();
$releases = new Releases;
$user = User::query()->where('api_token', $request->input('api_token'))->first();
if ($user === null) {
return response()->json(['error' => 'Invalid API Token'], 403);
+1 -1
View File
@@ -27,7 +27,7 @@ class RSS extends ApiController
public function __construct()
{
parent::__construct();
$this->releases = new Releases();
$this->releases = new Releases;
}
/**
+1 -1
View File
@@ -93,7 +93,7 @@ class XML_Response
$this->offset = $options['Offset'];
$this->type = $options['Type'];
$this->xml = new \XMLWriter();
$this->xml = new \XMLWriter;
$this->xml->openMemory();
$this->xml->setIndent(true);
}
+2 -2
View File
@@ -56,7 +56,7 @@ class BasePageController extends Controller
{
$this->middleware(['auth', 'web', '2fa'])->except('api', 'contact', 'showContactForm', 'callback', 'getNzb', 'terms', 'capabilities', 'movie', 'apiSearch', 'tv', 'details', 'failed', 'showRssDesc', 'fullFeedRss', 'categoryFeedRss', 'cartRss', 'myMoviesRss', 'myShowsRss', 'release');
// Buffer settings/DB connection.
$this->settings = new Settings();
$this->settings = new Settings;
$this->smarty = app('smarty.view');
foreach (Arr::get(config('ytake-laravel-smarty'), 'plugins_paths', []) as $plugins) {
@@ -177,7 +177,7 @@ class BasePageController extends Controller
$role = $this->userdata->roles_id;
}
$content = new Contents();
$content = new Contents;
if ($this->userdata !== null) {
$this->smarty->assign('recentforumpostslist', Forumpost::getPosts(Settings::settingValue('..showrecentforumposts')));
}
+3 -3
View File
@@ -15,7 +15,7 @@ class BrowseController extends BasePageController
public function index(Request $request)
{
$this->setPreferences();
$releases = new Releases();
$releases = new Releases;
$this->smarty->assign('category', -1);
@@ -62,7 +62,7 @@ class BrowseController extends BasePageController
public function show(Request $request, string $parentCategory, string $id = 'All'): void
{
$this->setPreferences();
$releases = new Releases();
$releases = new Releases;
$parentId = RootCategory::query()->where('title', $parentCategory)->value('id');
@@ -156,7 +156,7 @@ class BrowseController extends BasePageController
public function group(Request $request): void
{
$this->setPreferences();
$releases = new Releases();
$releases = new Releases;
if ($request->has('g')) {
$group = $request->input('g');
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
+2 -2
View File
@@ -19,8 +19,8 @@ class ConsoleController extends BasePageController
if ($id === 'WiiVare') {
$id = 'WiiVareVC';
}
$console = new Console();
$gen = new Genres();
$console = new Console;
$gen = new Genres;
$concats = Category::getChildren(Category::GAME_ROOT);
$ctmp = [];
+1 -1
View File
@@ -15,7 +15,7 @@ class ContentController extends BasePageController
public function show(Request $request)
{
$this->setPreferences();
$contents = new Contents();
$contents = new Contents;
$role = $this->userdata->role ?? 0;
+6 -6
View File
@@ -35,7 +35,7 @@ class DetailsController extends BasePageController
$this->setPreferences();
if ($guid !== null) {
$releases = new Releases();
$releases = new Releases;
$re = new ReleaseExtra;
$data = Release::getByGuid($guid);
$cpapi = $this->userdata->cp_api;
@@ -87,7 +87,7 @@ class DetailsController extends BasePageController
$xxx = '';
if ($data['xxxinfo_id'] !== '' && $data['xxxinfo_id'] !== 0) {
$x = new XXX();
$x = new XXX;
$xxx = $x->getXXXInfo($data['xxxinfo_id']);
if (isset($xxx['trailers'])) {
@@ -106,7 +106,7 @@ class DetailsController extends BasePageController
$game = '';
if ($data['gamesinfo_id'] !== '') {
$game = (new Games())->getGamesInfoById($data['gamesinfo_id']);
$game = (new Games)->getGamesInfoById($data['gamesinfo_id']);
}
$mus = '';
@@ -116,17 +116,17 @@ class DetailsController extends BasePageController
$book = '';
if ($data['bookinfo_id'] !== '') {
$book = (new Books())->getBookInfo($data['bookinfo_id']);
$book = (new Books)->getBookInfo($data['bookinfo_id']);
}
$con = '';
if ($data['consoleinfo_id'] !== '') {
$con = (new Console())->getConsoleInfo($data['consoleinfo_id']);
$con = (new Console)->getConsoleInfo($data['consoleinfo_id']);
}
$AniDBAPIArray = '';
if ($data['anidbid'] > 0) {
$AniDBAPIArray = (new AniDB())->getAnimeInfo($data['anidbid']);
$AniDBAPIArray = (new AniDB)->getAnimeInfo($data['anidbid']);
}
$pre = Predb::getForRelease($data['predb_id']);
+1 -1
View File
@@ -13,7 +13,7 @@ class FileListController extends BasePageController
public function show(string $guid): void
{
$this->setPreferences();
$nzb = new NZB();
$nzb = new NZB;
if ($guid !== null) {
$rel = Release::getByGuid($guid);
+1 -1
View File
@@ -84,7 +84,7 @@ class GetNzbController extends BasePageController
return response()->json(['message' => 'Unable to create .zip file'], 404);
}
$nzbPath = (new NZB())->getNZBPath($request->input('id'));
$nzbPath = (new NZB)->getNZBPath($request->input('id'));
if (! File::exists($nzbPath)) {
return Utility::showApiError(300, 'NZB file not found!');
+1 -1
View File
@@ -147,7 +147,7 @@ class MyMoviesController extends BasePageController
}
}
$ordering = (new Releases())->getBrowseOrdering();
$ordering = (new Releases)->getBrowseOrdering();
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
+1 -1
View File
@@ -175,7 +175,7 @@ class MyShowsController extends BasePageController
$shows = UserSerie::getShows($this->userdata->id);
$releases = new Releases();
$releases = new Releases;
$page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1;
$offset = ($page - 1) * config('nntmux.items_per_page');
+5 -5
View File
@@ -46,7 +46,7 @@ class RssController extends BasePageController
*/
public function myShowsRss(Request $request)
{
$rss = new RSS();
$rss = new RSS;
$offset = 0;
$user = $this->userCheck($request);
if (is_object($user)) {
@@ -68,7 +68,7 @@ class RssController extends BasePageController
public function fullFeedRss(Request $request)
{
$this->setPreferences();
$rss = new RSS();
$rss = new RSS;
$offset = 0;
$user = $this->userCheck($request);
if (is_object($user)) {
@@ -94,7 +94,7 @@ class RssController extends BasePageController
public function showRssDesc(): void
{
$this->setPreferences();
$rss = new RSS();
$rss = new RSS;
$title = 'Rss Info';
$meta_title = 'Rss Nzb Info';
@@ -137,7 +137,7 @@ class RssController extends BasePageController
*/
public function cartRss(Request $request): JsonResponse|array
{
$rss = new RSS();
$rss = new RSS;
$offset = 0;
$user = $this->userCheck($request);
if (is_object($user)) {
@@ -163,7 +163,7 @@ class RssController extends BasePageController
*/
public function categoryFeedRss(Request $request): JsonResponse|array
{
$rss = new RSS();
$rss = new RSS;
$offset = 0;
if ($request->missing('id')) {
return response()->json(['error' => 'Category ID is missing'], '403');
+1 -1
View File
@@ -15,7 +15,7 @@ class SearchController extends BasePageController
public function search(Request $request): void
{
$this->setPreferences();
$releases = new Releases();
$releases = new Releases;
$meta_title = 'Search Nzbs';
$meta_keywords = 'search,nzb,description,details';
+1 -1
View File
@@ -16,7 +16,7 @@ class SeriesController extends BasePageController
public function index(Request $request, string $id = ''): void
{
$this->setPreferences();
$releases = new Releases();
$releases = new Releases;
$title = 'Series';
$meta_title = 'View TV Series';
$meta_keywords = 'view,series,tv,show,description,details';
+6 -6
View File
@@ -108,11 +108,11 @@ class Predb extends Model
*/
public static function checkPre(bool|int|string $dateLimit = false): void
{
$consoleTools = new ConsoleTools();
$consoleTools = new ConsoleTools;
$updated = 0;
if (config('nntmux.echocli')) {
(new ColorCLI())->header('Querying DB for release search names not matched with PreDB titles.');
(new ColorCLI)->header('Querying DB for release search names not matched with PreDB titles.');
}
$query = self::query()
@@ -127,7 +127,7 @@ class Predb extends Model
if ($res !== null) {
$total = \count($res);
(new ColorCLI())->primary(number_format($total).' releases to match.');
(new ColorCLI)->primary(number_format($total).' releases to match.');
foreach ($res as $row) {
Release::query()->where('id', $row['releases_id'])->update(['predb_id' => $row['predb_id']]);
@@ -143,7 +143,7 @@ class Predb extends Model
}
if (config('nntmux.echocli')) {
(new ColorCLI())->header(
(new ColorCLI)->header(
'Matched '.number_format(($updated > 0) ? $updated : 0).' PreDB titles to release search names.'
);
}
@@ -198,9 +198,9 @@ class Predb extends Model
$sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate');
if (! empty($search)) {
if (config('nntmux.elasticsearch_enabled') === true) {
$ids = (new ElasticSearchSiteSearch())->predbIndexSearch($search);
$ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search);
} else {
$manticore = new ManticoreSearch();
$manticore = new ManticoreSearch;
$ids = Arr::get($manticore->searchIndexes('predb_rt', $search, ['title']), 'id');
}
$sql->whereIn('predb.id', $ids);
+6 -6
View File
@@ -261,9 +261,9 @@ class Release extends Model
);
if (config('nntmux.elasticsearch_enabled') === true) {
(new ElasticSearchSiteSearch())->insertRelease($parameters);
(new ElasticSearchSiteSearch)->insertRelease($parameters);
} else {
(new ManticoreSearch())->insertRelease($parameters);
(new ManticoreSearch)->insertRelease($parameters);
}
return $parameters['id'];
@@ -298,9 +298,9 @@ class Release extends Model
);
if (config('nntmux.elasticsearch_enabled') === true) {
(new ElasticSearchSiteSearch())->updateRelease($id);
(new ElasticSearchSiteSearch)->updateRelease($id);
} else {
(new ManticoreSearch())->updateRelease($id);
(new ManticoreSearch)->updateRelease($id);
}
}
@@ -528,9 +528,9 @@ class Release extends Model
if (! empty($similar)) {
if (config('nntmux.elasticsearch_enabled') === true) {
$searchResult = (new ElasticSearchSiteSearch())->indexSearch($similar[1], 10);
$searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
} else {
$searchResult = (new ManticoreSearch())->searchIndexes('releases_rt', $similar[1]);
$searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
if (! empty($searchResult)) {
$searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
}
+2 -2
View File
@@ -125,9 +125,9 @@ class ReleaseFile extends Model
ParHash::insertOrIgnore(['releases_id' => $id, 'hash' => $hash]);
}
if (config('nntmux.elasticsearch_enabled') === true) {
(new ElasticSearchSiteSearch())->updateRelease($id);
(new ElasticSearchSiteSearch)->updateRelease($id);
} else {
(new ManticoreSearch())->updateRelease($id);
(new ManticoreSearch)->updateRelease($id);
}
}
+4 -4
View File
@@ -391,9 +391,9 @@ class UsenetGroup extends Model
$res->get();
$releases = new Releases();
$nzb = new NZB();
$releaseImage = new ReleaseImage();
$releases = new Releases;
$nzb = new NZB;
$releaseImage = new ReleaseImage;
foreach ($res as $row) {
$releases->deleteSingle(
[
@@ -484,6 +484,6 @@ class UsenetGroup extends Model
public static function disableIfNotExist(int $id): void
{
self::updateGroupStatus($id, 'active');
(new ColorCLI())->error('Group does not exist on server, disabling');
(new ColorCLI)->error('Group does not exist on server, disabling');
}
}
+1 -1
View File
@@ -22,4 +22,4 @@ if ($passFiles->isNotEmpty()) {
}
}
}
(new ColorCLI())->info($count2.' releases marked as passworded');
(new ColorCLI)->info($count2.' releases marked as passworded');
+2 -2
View File
@@ -7,8 +7,8 @@ use Blacklight\ColorCLI;
use Blacklight\ConsoleTools;
use Illuminate\Support\Facades\DB;
$consoletools = new ConsoleTools();
$colorCli = new ColorCLI();
$consoletools = new ConsoleTools;
$colorCli = new ColorCLI;
$ran = false;
if (isset($argv[1]) && $argv[1] === 'all' && isset($argv[2]) && $argv[2] === 'true') {
+4 -4
View File
@@ -12,7 +12,7 @@ use Blacklight\utility\Utility;
use Illuminate\Support\Facades\File;
$dir = resource_path().'/movednzbs/';
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) {
$colorCli->error("This script can remove all nzbs not found in the db and all releases with no nzbs found. It can also move invalid nzbs.\n\n"
@@ -25,9 +25,9 @@ if (! File::isDirectory($dir) && ! File::makeDirectory($dir)) {
exit("ERROR: Could not create folder [$dir].".PHP_EOL);
}
$releases = new Releases();
$nzb = new NZB();
$releaseImage = new ReleaseImage();
$releases = new Releases;
$nzb = new NZB;
$releaseImage = new ReleaseImage;
$timestart = now()->toRfc2822String();
$checked = $moved = 0;
+2 -2
View File
@@ -51,8 +51,8 @@ if (\count($releases) === 0) {
exit('No releases found in your database for group '.$argv[1].PHP_EOL);
}
$releaseCleaner = new ReleaseCleaning();
$manticore = new ManticoreSearch();
$releaseCleaner = new ReleaseCleaning;
$manticore = new ManticoreSearch;
foreach ($releases as $release) {
echo '.';
+2 -2
View File
@@ -10,8 +10,8 @@ if (! isset($argv[1]) || ! isset($argv[2])) {
exit("ERROR: You must supply the level you want to reorganize it to, and the source directory (You would use: 3 .../newznab/resources/nzb/ to move it to 3 levels deep)\n");
}
$nzb = new NZB();
$consoleTools = new ConsoleTools();
$nzb = new NZB;
$consoleTools = new ConsoleTools;
$newLevel = $argv[1];
$sourcePath = $argv[2];
+1 -1
View File
@@ -10,7 +10,7 @@ use Blacklight\Movie;
use Illuminate\Support\Facades\DB;
$movie = new Movie(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$path2cover = storage_path('covers/movies/');
+5 -5
View File
@@ -14,15 +14,15 @@ use Blacklight\Releases;
use Illuminate\Support\Facades\DB;
$pdo = DB::connection()->getPdo();
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$path2preview = storage_path('covers/preview');
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
$releases = new Releases();
$nzb = new NZB();
$releaseImage = new ReleaseImage();
$consoletools = new ConsoleTools();
$releases = new Releases;
$nzb = new NZB;
$releaseImage = new ReleaseImage;
$consoletools = new ConsoleTools;
$couldbe = $argv[1] === 'true' ? $couldbe = 'were ' : 'could be ';
$limit = $counterfixed = 0;
if (isset($argv[2]) && is_numeric($argv[2])) {
+1 -1
View File
@@ -11,7 +11,7 @@ use Illuminate\Support\Facades\DB;
$pdo = DB::connection()->getPdo();
$console = new Console(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$res = $pdo->query(
sprintf(
+1 -1
View File
@@ -10,7 +10,7 @@ use Illuminate\Support\Facades\DB;
$pdo = DB::connection()->getPdo();
$game = new Games(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$res = $pdo->query(
sprintf('SELECT id, title FROM gamesinfo WHERE cover = 0 ORDER BY id DESC LIMIT 100')
+1 -1
View File
@@ -9,7 +9,7 @@ use Illuminate\Support\Facades\DB;
$pdo = DB::connection()->getPdo();
$movie = new Movie(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$movies = $pdo->query('SELECT imdbid FROM movieinfo WHERE tmdbid = 0 ORDER BY id ASC');
if ($movies instanceof Traversable) {
+1 -1
View File
@@ -8,7 +8,7 @@ use Blacklight\ColorCLI;
use Blacklight\Movie;
$movie = new Movie(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$movies = MovieInfo::query()->where('cover', '=', 0)->orderBy('year')->orderByDesc('id')->get(['imdbid']);
$count = $movies->count();
+1 -1
View File
@@ -9,7 +9,7 @@ use Blacklight\Movie;
use Blacklight\processing\tv\TraktTv;
$movie = new Movie(['Echo' => true]);
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$movies = MovieInfo::query()->where('imdbid', '<>', 0)->where('traktid', '=', 0)->get(['imdbid']);
$count = $movies->count();
+2 -2
View File
@@ -7,8 +7,8 @@ use Blacklight\ColorCLI;
use Blacklight\XXX;
use Illuminate\Support\Facades\DB;
$movie = new XXX();
$c = new ColorCLI();
$movie = new XXX;
$c = new ColorCLI;
$movies = DB::select('SELECT title FROM xxxinfo WHERE cover = 0');
+2 -2
View File
@@ -8,12 +8,12 @@ use Blacklight\ReleaseImage;
use Illuminate\Support\Facades\DB;
$pdo = DB::connection()->getPdo();
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
$path2cover = storage_path('covers/sample/');
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
$releaseImage = new ReleaseImage();
$releaseImage = new ReleaseImage;
$couldbe = $argv[1] === 'true' ? $couldbe = 'had ' : 'could have ';
$limit = $counterfixed = 0;
if (isset($argv[2]) && is_numeric($argv[2])) {
+1 -1
View File
@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\File;
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/book and compare to db->bookinfo.\nTo run:\nphp $argv[0] true\n");
@@ -7,7 +7,7 @@ use Blacklight\ColorCLI;
use Illuminate\Support\Facades\File;
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/console and compare to db->consoleinfo.\nTo run:\nphp $argv[0] true\n");
+1 -1
View File
@@ -7,7 +7,7 @@ use Blacklight\ColorCLI;
use Illuminate\Support\Facades\File;
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/games and compare to db->gamesinfo.\nTo run:\nphp $argv[0] true\n");
+1 -1
View File
@@ -7,7 +7,7 @@ use Blacklight\ColorCLI;
use Illuminate\Support\Facades\File;
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/movies and compare to db->movieinfo.\nTo run:\nphp $argv[0] true\n");
+1 -1
View File
@@ -7,7 +7,7 @@ use Blacklight\ColorCLI;
use Illuminate\Support\Facades\File;
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/music and compare to db->musicinfo.\nTo run:\nphp $argv[0] true\n");
+1 -1
View File
@@ -7,7 +7,7 @@ use Blacklight\ColorCLI;
use Illuminate\Support\Facades\File;
$covers = $updated = $deleted = 0;
$colorCli = new ColorCLI();
$colorCli = new ColorCLI;
if ($argc === 1 || $argv[1] !== 'true') {
$colorCli->error("\nThis script will check all images in covers/xxx and compare to db->xxxinfo.\nTo run:\nphp $argv[0] true\n");

Some files were not shown because too many files have changed in this diff Show More