mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 09:18:54 +00:00
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\PopulateAniListService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class NntmuxPopulateAniDB extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'nntmux:populate-anidb
|
|
{--info : Populate info only}
|
|
{--anilistid : Populate tables for specific AniList ID}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Populate AniList table (replaces AniDB)';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
$palist = new PopulateAniListService;
|
|
|
|
if ($this->option('info') && is_numeric($this->option('anilistid'))) {
|
|
$palist->populateTable('info', $this->option('anilistid'));
|
|
} elseif ($this->option('info')) {
|
|
$palist->populateTable('info');
|
|
} else {
|
|
$this->error('Please specify --info option');
|
|
|
|
return;
|
|
}
|
|
|
|
$this->info('AniList tables populated with requested data');
|
|
}
|
|
}
|