✨ 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
36
app/Data/WatchFile.php
Normal file
36
app/Data/WatchFile.php
Normal 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)
|
||||
;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue