From 5fd2fd103e67d7c4f5d7c58c0a357ebe9e3a8750 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Mon, 27 Oct 2025 08:54:39 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20current=20tiem=20to=20output?= =?UTF-8?q?=20filename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Data/DataPipes/ParseWatchFile.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Data/DataPipes/ParseWatchFile.php b/app/Data/DataPipes/ParseWatchFile.php index 14ac0d9..efef277 100644 --- a/app/Data/DataPipes/ParseWatchFile.php +++ b/app/Data/DataPipes/ParseWatchFile.php @@ -20,18 +20,21 @@ class ParseWatchFile implements DataPipe { public function handle(mixed $payload, DataClass $class, Collection $properties): Collection { + $n = now()->format('U'); $properties['watched'] = Carbon::now(); $properties['output'] = match ($properties['type']) { Type::Movie => sprintf( - '%s-%d.json', + '%s-%d-%s.json', Str::slug($properties['showTitle'] ?? uniqid()), $properties['movieYear'], + $n, ), default => sprintf( - '%s-%dx%02d.json', + '%s-%dx%02d-%s.json', Str::slug($properties['showTitle'] ?? uniqid()), $properties['season'], - $properties['episode'] + $properties['episode'], + $n, ), };