mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
@@ -499,8 +499,7 @@ class Music
|
||||
|
||||
if ($musicId) {
|
||||
if ($this->echooutput) {
|
||||
|
||||
ColorCLI::header(PHP_EOL.'Added/updated album: ').
|
||||
ColorCLI::header(PHP_EOL.'Added/updated album: ').
|
||||
ColorCLI::alternateOver(' Artist: ').
|
||||
ColorCLI::primary($mus['artist']).
|
||||
ColorCLI::alternateOver(' Title: ').
|
||||
@@ -517,7 +516,7 @@ class Music
|
||||
$artist = 'Artist: '.$mus['artist'].', Album: ';
|
||||
}
|
||||
|
||||
ColorCLI::headerOver('Nothing to update: ').
|
||||
ColorCLI::headerOver('Nothing to update: ').
|
||||
ColorCLI::primaryOver(
|
||||
$artist.
|
||||
$mus['title'].
|
||||
@@ -632,8 +631,7 @@ class Music
|
||||
})->whereIn('categories_id', [Category::MUSIC_MP3, Category::MUSIC_LOSSLESS, Category::MUSIC_OTHER])->orderBy('postdate', 'DESC')->limit($this->musicqty)->get(['searchname', 'id']);
|
||||
if ($res instanceof \Traversable && ! empty($res)) {
|
||||
if ($this->echooutput) {
|
||||
|
||||
ColorCLI::header(
|
||||
ColorCLI::header(
|
||||
'Processing '.$res->count().' music release(s).'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -874,7 +874,6 @@ class NameFixer
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
|
||||
ColorCLI::headerOver('New name: ').
|
||||
ColorCLI::primary(substr($newName, 0, 299)).
|
||||
ColorCLI::headerOver('Old name: ').
|
||||
|
||||
+1
-2
@@ -601,8 +601,7 @@ class XXX
|
||||
}
|
||||
|
||||
if ($this->echoOutput) {
|
||||
|
||||
ColorCLI::headerOver(($xxxID !== false ? 'Added/updated XXX movie: '.ColorCLI::primary($mov['title']) : 'Nothing to update for XXX movie: '.ColorCLI::primary($mov['title'])));
|
||||
ColorCLI::headerOver(($xxxID !== false ? 'Added/updated XXX movie: '.ColorCLI::primary($mov['title']) : 'Nothing to update for XXX movie: '.ColorCLI::primary($mov['title'])));
|
||||
}
|
||||
|
||||
return $xxxID;
|
||||
|
||||
@@ -399,16 +399,14 @@ class AniDB
|
||||
$AniDBAPIArray = $this->getAniDbAPI($anidb['anidbid']);
|
||||
|
||||
if ($this->banned === true) {
|
||||
|
||||
ColorCLI::error(
|
||||
ColorCLI::error(
|
||||
'AniDB Banned, import will fail, please wait 24 hours before retrying.'
|
||||
);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($AniDBAPIArray === false && $this->echooutput) {
|
||||
|
||||
ColorCLI::info(
|
||||
ColorCLI::info(
|
||||
'Anime ID: '.$anidb['anidbid'].' not available for update yet.'
|
||||
);
|
||||
} else {
|
||||
@@ -420,16 +418,14 @@ class AniDB
|
||||
$AniDBAPIArray = $this->getAniDbAPI($anidbId);
|
||||
|
||||
if ($this->banned === true) {
|
||||
|
||||
ColorCLI::error(
|
||||
ColorCLI::error(
|
||||
'AniDB Banned, import will fail, please wait 24 hours before retrying.'
|
||||
);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($AniDBAPIArray === false && $this->echooutput) {
|
||||
|
||||
ColorCLI::info(
|
||||
ColorCLI::info(
|
||||
'Anime ID: '.$anidbId.' not available for update yet.'
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -211,8 +211,7 @@ class Forking extends \fork_daemon
|
||||
$this->processEndWork();
|
||||
|
||||
if (config('nntmux.echocli')) {
|
||||
|
||||
ColorCLI::header(
|
||||
ColorCLI::header(
|
||||
'Multi-processing for '.$this->workType.' finished in '.(microtime(true) - $startTime).
|
||||
' seconds at '.date(DATE_RFC2822).'.'.PHP_EOL
|
||||
);
|
||||
@@ -304,8 +303,7 @@ class Forking extends \fork_daemon
|
||||
$this->_workCount = \count($this->work);
|
||||
if ($this->_workCount > 0) {
|
||||
if (config('nntmux.echocli')) {
|
||||
|
||||
ColorCLI::header(
|
||||
ColorCLI::header(
|
||||
'Multi-processing started at '.date(DATE_RFC2822).' for '.$this->workType.' with '.$this->_workCount.
|
||||
' job(s) to do using a max of '.$this->maxProcesses.' child process(es).'
|
||||
);
|
||||
@@ -314,8 +312,7 @@ class Forking extends \fork_daemon
|
||||
$this->addwork($this->work);
|
||||
$this->process_work(true);
|
||||
} elseif (config('nntmux.echocli')) {
|
||||
|
||||
ColorCLI::header('No work to do!');
|
||||
ColorCLI::header('No work to do!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1102,7 +1099,7 @@ class Forking extends \fork_daemon
|
||||
public function childExit($pid, $identifier = '')
|
||||
{
|
||||
if (config('nntmux.echocli')) {
|
||||
ColorCLI::header(
|
||||
ColorCLI::header(
|
||||
'Process ID #'.$pid.' has completed.'.PHP_EOL.
|
||||
'There are '.($this->forked_children_count - 1).' process(es) still active with '.
|
||||
(--$this->_workCount).' job(s) left in the queue.'.PHP_EOL
|
||||
|
||||
@@ -86,8 +86,7 @@ class ForkingImportNZB extends Forking
|
||||
$this->process_work(true);
|
||||
|
||||
if (config('nntmux.echocli')) {
|
||||
|
||||
ColorCLI::header(
|
||||
ColorCLI::header(
|
||||
'Multi-processing for import finished in '.(microtime(true) - $startTime).
|
||||
' seconds at '.date(DATE_RFC2822).'.'.PHP_EOL
|
||||
);
|
||||
|
||||
@@ -254,7 +254,6 @@ class AniDB
|
||||
|
||||
$this->updateRelease($anidbId->anidbid, $release->id);
|
||||
|
||||
|
||||
ColorCLI::headerOver('Matched '.$type.' AniDB ID: ').
|
||||
ColorCLI::primary($anidbId->anidbid).
|
||||
ColorCLI::alternateOver(' Title: ').
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
use Colors\Color;
|
||||
use Blacklight\XXX;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
|
||||
@@ -18,8 +18,7 @@ if ($argc > 1 && $argv[1] === 'true' && isset($argv[2])) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
ColorCLI::error(
|
||||
ColorCLI::error(
|
||||
'To execute this script you must provide a boolean argument.'.PHP_EOL.
|
||||
'Argument1: true|false to run this script or not'.PHP_EOL.
|
||||
'Argument2: full|info for what type of data to populate.'.PHP_EOL.
|
||||
|
||||
@@ -50,8 +50,8 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
|
||||
}
|
||||
ColorCLI::header('Total releases missing samples that '.$couldbe.'their samples updated = '.number_format($counterfixed));
|
||||
} else {
|
||||
ColorCLI::header("\nThis script checks if XXX release samples actually exist on disk.\n\n"
|
||||
ColorCLI::header("\nThis script checks if XXX release samples actually exist on disk.\n\n"
|
||||
."php $argv[0] check ...: Dry run, displays missing samples.\n"
|
||||
."php $argv[0] true ...: Update XXX releases missing samples.\n");
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ use Illuminate\Support\Facades\DB;
|
||||
$covers = $updated = $deleted = 0;
|
||||
|
||||
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");
|
||||
exit();
|
||||
ColorCLI::error("\nThis script will check all images in covers/games and compare to db->gamesinfo.\nTo run:\nphp $argv[0] true\n");
|
||||
exit();
|
||||
}
|
||||
|
||||
$pdo = DB::connection()->getPdo();
|
||||
|
||||
Reference in New Issue
Block a user