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

36
app/Data/WatchFile.php Normal file
View file

@ -0,0 +1,36 @@
<?php
namespace App\Data;
use Illuminate\Support\Carbon;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\DataPipeline;
class WatchFile extends Data
{
#[WithCast(Casts\File::class)]
public string $path;
public ?string $output = null;
public ?string $showNfo = null;
public ?string $showTmdb = null;
public ?string $showImdb = null;
public ?string $showTitle = null;
public ?string $epNfo = null;
public int $season = 0;
public int $episode = 0;
public Carbon $watched;
public static function fromPath(string $path): static
{
return static::from(['path' => $path]);
}
public static function pipeline(): DataPipeline
{
return parent::pipeline()
->through(DataPipes\GetShowTmdb::class)
->through(DataPipes\GetSeasonEp::class)
->through(DataPipes\ParseWatchFile::class)
;
}
}