✨ Export watched show based on nfo files
Still a work in progress. But enough to get me going now.
This commit is contained in:
parent
a4aab55616
commit
b7534c01f5
8 changed files with 183 additions and 1 deletions
25
app/Commands/TraktWatchExport.php
Normal file
25
app/Commands/TraktWatchExport.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue