From f14e29a54f9a754be1ef0037823f83cd2ab78430 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 18 Sep 2024 18:16:31 +1000 Subject: [PATCH] Cosmetic code fixes and fix (relax) width/heigh comparison when catalog scanning --- app/Jobs/CatalogScan.php | 2 +- app/Media/QuickTime.php | 2 +- app/Media/QuickTime/Atom.php | 4 ++-- app/Media/QuickTime/Atoms/SubAtom.php | 4 ++-- app/Media/QuickTime/Atoms/moov/trak/mdia/minf/stbl/stsd.php | 4 ---- app/Models/Video.php | 5 +---- composer.json | 2 +- 7 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/Jobs/CatalogScan.php b/app/Jobs/CatalogScan.php index 9d5e2af..1cbce10 100644 --- a/app/Jobs/CatalogScan.php +++ b/app/Jobs/CatalogScan.php @@ -62,7 +62,7 @@ class CatalogScan implements ShouldQueue, ShouldBeUnique // Check the details are valid if ($this->o->file_signature === $this->o->getObjectOriginal('file_signature')) { // For sanity, we'll check a couple of other attrs - if (($this->o->width !== $this->o->getObjectOriginal('width')) || ($this->o->height !== $this->o->getObjectOriginal('height'))) { + if (($this->o->width != $this->o->getObjectOriginal('width')) || ($this->o->height != $this->o->getObjectOriginal('height'))) { Log::alert(sprintf('Dimensions [%s] (%s x %s) mismatch for [%s]', $this->o->dimensions, $this->o->getObjectOriginal('width'), diff --git a/app/Media/QuickTime.php b/app/Media/QuickTime.php index 1db100b..4d2d9bb 100644 --- a/app/Media/QuickTime.php +++ b/app/Media/QuickTime.php @@ -49,7 +49,7 @@ class QuickTime extends Base { case 'duration': case 'preferred_rate': case 'preferred_volume': - // Height/Width is in the moov/trak/tkhd attom + // Height/Width is in the moov/trak/tkhd atom case 'height': case 'width': $atom = $this->find_atoms(moov::class,1); diff --git a/app/Media/QuickTime/Atom.php b/app/Media/QuickTime/Atom.php index ea6d169..eba1181 100644 --- a/app/Media/QuickTime/Atom.php +++ b/app/Media/QuickTime/Atom.php @@ -49,9 +49,9 @@ abstract class Atom return $subatom->{$key}; - // Height is in the moov/trak/tkhd attom + // Height is in the moov/trak/tkhd atom case 'height': - // Width is in the moov/trak/tkhd attom + // Width is in the moov/trak/tkhd atom case 'width': $atom = $this->find_atoms(trak::class); diff --git a/app/Media/QuickTime/Atoms/SubAtom.php b/app/Media/QuickTime/Atoms/SubAtom.php index d48c472..c8f99b2 100644 --- a/app/Media/QuickTime/Atoms/SubAtom.php +++ b/app/Media/QuickTime/Atoms/SubAtom.php @@ -23,9 +23,9 @@ abstract class SubAtom extends Atom public function __get(string $key): mixed { switch ($key) { - // Height is in the moov/trak/tkhd attom + // Height is in the moov/trak/tkhd atom case 'height': - // Width is in the moov/trak/tkhd attom + // Width is in the moov/trak/tkhd atom case 'width': $atom = $this->find_atoms(tkhd::class,1); diff --git a/app/Media/QuickTime/Atoms/moov/trak/mdia/minf/stbl/stsd.php b/app/Media/QuickTime/Atoms/moov/trak/mdia/minf/stbl/stsd.php index 6d053a5..90c73ac 100644 --- a/app/Media/QuickTime/Atoms/moov/trak/mdia/minf/stbl/stsd.php +++ b/app/Media/QuickTime/Atoms/moov/trak/mdia/minf/stbl/stsd.php @@ -93,10 +93,6 @@ class stsd extends SubAtom case 'video_codec': return Arr::get($this->video,'codec'); - case 'video_framerate': - dd($this); - // return Arr::get($this->video,'codec'); - default: return parent::__get($key); } diff --git a/app/Models/Video.php b/app/Models/Video.php index 2828d3a..e2c4802 100644 --- a/app/Models/Video.php +++ b/app/Models/Video.php @@ -2,9 +2,6 @@ namespace App\Models; -use Illuminate\Support\Facades\Log; - -use App\Jobs\CatalogMove; use App\Media\{Base,Factory}; class Video extends Abstracted\Catalog @@ -60,7 +57,7 @@ class Video extends Abstracted\Catalog /* $x = new \getID3; $x->analyze($this->file_name(FALSE)); - dump(['id3'=>$x]); + dump(['id3'=>$x,'me'=>$this]); */ } diff --git a/composer.json b/composer.json index dd51627..7e59a52 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "require": { "php": "^8.3", "ext-fileinfo": "*", - "ext-pdo": "*", "ext-imagick": "*", + "ext-pdo": "*", "laravel/framework": "^11.0", "laravel/ui": "^4.5", "leenooks/laravel": "^11.1",