vid-queue/app/Commands/TraktWatchImport.php
2023-03-22 20:39:09 -05:00

20 lines
542 B
PHP

<?php
namespace App\Commands;
use App\Data\WatchData;
use App\Services\Trakt;
class TraktWatchImport extends Command
{
protected $signature = 'show:watch:import {files* : JSON files to import}';
protected $description = 'Once online, sync watches from show:watch:export';
public function handle(): int
{
$watched = WatchData::from($this->arguments());
$resp = $this->app->make(Trakt::class)->syncHistory($watched, $this->output);
return $resp->ok() ? static::SUCCESS : static::FAILURE;
}
}