Cosmetic code fixes and fix (relax) width/heigh comparison when catalog scanning

This commit is contained in:
Deon George 2024-09-18 18:16:31 +10:00
parent 75313d8dd1
commit f14e29a54f
7 changed files with 8 additions and 15 deletions

View File

@ -62,7 +62,7 @@ class CatalogScan implements ShouldQueue, ShouldBeUnique
// Check the details are valid // Check the details are valid
if ($this->o->file_signature === $this->o->getObjectOriginal('file_signature')) { if ($this->o->file_signature === $this->o->getObjectOriginal('file_signature')) {
// For sanity, we'll check a couple of other attrs // 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]', Log::alert(sprintf('Dimensions [%s] (%s x %s) mismatch for [%s]',
$this->o->dimensions, $this->o->dimensions,
$this->o->getObjectOriginal('width'), $this->o->getObjectOriginal('width'),

View File

@ -49,7 +49,7 @@ class QuickTime extends Base {
case 'duration': case 'duration':
case 'preferred_rate': case 'preferred_rate':
case 'preferred_volume': case 'preferred_volume':
// Height/Width is in the moov/trak/tkhd attom // Height/Width is in the moov/trak/tkhd atom
case 'height': case 'height':
case 'width': case 'width':
$atom = $this->find_atoms(moov::class,1); $atom = $this->find_atoms(moov::class,1);

View File

@ -49,9 +49,9 @@ abstract class Atom
return $subatom->{$key}; return $subatom->{$key};
// Height is in the moov/trak/tkhd attom // Height is in the moov/trak/tkhd atom
case 'height': case 'height':
// Width is in the moov/trak/tkhd attom // Width is in the moov/trak/tkhd atom
case 'width': case 'width':
$atom = $this->find_atoms(trak::class); $atom = $this->find_atoms(trak::class);

View File

@ -23,9 +23,9 @@ abstract class SubAtom extends Atom
public function __get(string $key): mixed public function __get(string $key): mixed
{ {
switch ($key) { switch ($key) {
// Height is in the moov/trak/tkhd attom // Height is in the moov/trak/tkhd atom
case 'height': case 'height':
// Width is in the moov/trak/tkhd attom // Width is in the moov/trak/tkhd atom
case 'width': case 'width':
$atom = $this->find_atoms(tkhd::class,1); $atom = $this->find_atoms(tkhd::class,1);

View File

@ -93,10 +93,6 @@ class stsd extends SubAtom
case 'video_codec': case 'video_codec':
return Arr::get($this->video,'codec'); return Arr::get($this->video,'codec');
case 'video_framerate':
dd($this);
// return Arr::get($this->video,'codec');
default: default:
return parent::__get($key); return parent::__get($key);
} }

View File

@ -2,9 +2,6 @@
namespace App\Models; namespace App\Models;
use Illuminate\Support\Facades\Log;
use App\Jobs\CatalogMove;
use App\Media\{Base,Factory}; use App\Media\{Base,Factory};
class Video extends Abstracted\Catalog class Video extends Abstracted\Catalog
@ -60,7 +57,7 @@ class Video extends Abstracted\Catalog
/* /*
$x = new \getID3; $x = new \getID3;
$x->analyze($this->file_name(FALSE)); $x->analyze($this->file_name(FALSE));
dump(['id3'=>$x]); dump(['id3'=>$x,'me'=>$this]);
*/ */
} }

View File

@ -7,8 +7,8 @@
"require": { "require": {
"php": "^8.3", "php": "^8.3",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-pdo": "*",
"ext-imagick": "*", "ext-imagick": "*",
"ext-pdo": "*",
"laravel/framework": "^11.0", "laravel/framework": "^11.0",
"laravel/ui": "^4.5", "laravel/ui": "^4.5",
"leenooks/laravel": "^11.1", "leenooks/laravel": "^11.1",