vid-queue/app/Commands/TraktWatchImport.php

21 lines
530 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Commands;
use App\Data\WatchData;
2023-03-22 20:39:09 -05:00
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';
2023-06-22 18:59:19 -05:00
public function handle(Trakt $trakt): int
{
$watched = WatchData::from($this->arguments());
2023-06-22 18:59:19 -05:00
$resp = $trakt->syncHistory($watched, $this->output);
2023-03-22 20:39:09 -05:00
return $resp->ok() ? static::SUCCESS : static::FAILURE;
}
}