Export watched show based on nfo files

Still a work in progress. But enough to get me going now.
This commit is contained in:
Dan Jones 2022-09-13 16:50:10 -05:00
commit b7534c01f5
8 changed files with 183 additions and 1 deletions

View file

@ -0,0 +1,25 @@
<?php
namespace App\Commands;
use App\Data\WatchFile;
class TraktWatchExport extends Command
{
protected $signature = 'show:watch:export {file : File to watch}';
protected $description = 'Create a json file to mark watched and import with show:watch:import when online';
public function handle(): int
{
$file = WatchFile::from($this->argument('file'));
$ret = file_put_contents($file->output, $file->toJson());
if ($ret) {
$this->line("Saved to {$file->output}");
} else {
$this->error('Failed to export');
}
return $ret ? static::SUCCESS : static::FAILURE;
}
}