From a6796a24ae964c6d573c246cc200d4c1ad8a1d72 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 18 Sep 2024 09:32:08 +1000 Subject: [PATCH] Change ScanAll logic, we'll just queue a scan instead of recording some info initially --- app/Console/Commands/CatalogScanAll.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Console/Commands/CatalogScanAll.php b/app/Console/Commands/CatalogScanAll.php index 60ebd54..016b34f 100644 --- a/app/Console/Commands/CatalogScanAll.php +++ b/app/Console/Commands/CatalogScanAll.php @@ -64,7 +64,6 @@ class CatalogScanAll extends Command $o = new $class; $o->filename = $file; - $o->file_signature = $o->getObjectOriginal('file_signature'); $o->save(); CatalogScan::dispatch($o) @@ -77,30 +76,29 @@ class CatalogScanAll extends Command // Check the details are valid if ($o->file_signature === $o->getObjectOriginal('file_signature')) { // For sanity, we'll check a couple of other attrs - if (($o->width !== $o->getObjectOriginal('width')) || ($o->height !== $o->getObjectOriginal('height'))) + if (($o->width !== $o->getObjectOriginal('width')) || ($o->height !== $o->getObjectOriginal('height'))) { Log::alert(sprintf('Dimensions [%s] (%s x %s) mismatch for [%s]', $o->dimensions, $o->getObjectOriginal('width'), $o->getObjectOriginal('height'), $o->file_name(FALSE))); + $c++; + continue; + } + } else { Log::alert(sprintf('File Signature [%s] doesnt match [%s] for [%s]', $o->getObjectOriginal('file_signature'), $o->file_signature, $o->file_name(FALSE))); + + $c++; + continue; } - if ($o->signature !== $o->getObjectOriginal('signature')) { - Log::notice(sprintf('Updating image signature for [%s] to [%s] was [%s]',$o->filename,$o->signature,$o->getObjectOriginal('signature'))); - - $o->signature = $o->getObjectOriginal('signature'); - } - - if ($o->isDirty()) - $o->save(); - else - $o->touch(); + $o->scanned = FALSE; + $o->touch(); if ($this->option('scan')) { Log::info(sprintf('Forcing re-scan of [%s] - queued',$o->filename));