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));