mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 10:18:55 +00:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
@@ -4,11 +4,11 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Group;
|
||||
use App\Models\Settings;
|
||||
use Illuminate\Console\Command;
|
||||
use nntmux\SphinxSearch;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use nntmux\SphinxSearch;
|
||||
|
||||
class NntmuxResetDb extends Command
|
||||
{
|
||||
@@ -41,7 +41,6 @@ class NntmuxResetDb extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
if ($this->confirm('This script removes all releases, nzb files, samples, previews , nfos, truncates all article tables and resets all groups. Are you sure you want reset the DB?')) {
|
||||
$timestart = Carbon::now();
|
||||
|
||||
@@ -50,7 +49,7 @@ class NntmuxResetDb extends Command
|
||||
'first_record_postdate' => null,
|
||||
'last_record' => 0,
|
||||
'last_record_postdate' => null,
|
||||
'last_updated' => null
|
||||
'last_updated' => null,
|
||||
]);
|
||||
$this->info('Reseting all groups completed.');
|
||||
|
||||
@@ -115,4 +114,4 @@ class NntmuxResetDb extends Command
|
||||
$this->info('Script execution stopped');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use nntmux\ColorCLI;
|
||||
use App\Models\Group;
|
||||
use App\Models\Release;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use nntmux\ColorCLI;
|
||||
|
||||
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) {
|
||||
Group::query()->update(['first_record' => 0, 'first_record_postdate' => null, 'last_record' => 0, 'last_record_postdate' => null, 'last_updated' => null]);
|
||||
@@ -38,7 +38,7 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) {
|
||||
} else {
|
||||
$rel = DB::unprepared("TRUNCATE TABLE $tbl");
|
||||
DB::commit();
|
||||
if ($rel ===true) {
|
||||
if ($rel === true) {
|
||||
echo ColorCLI::primary("Truncating $tbl completed.");
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'drop')) {
|
||||
ColorCLI::doEcho(ColorCLI::error(
|
||||
'This script removes releases with no NZBs, resets all groups, truncates or drops(tpg)
|
||||
article tables. All other releases are left alone.
|
||||
php '. $argv[0].' [true, drop] ...: To reset all groups and truncate/drop the tables.'
|
||||
php '.$argv[0].' [true, drop] ...: To reset all groups and truncate/drop the tables.'
|
||||
)
|
||||
);
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user