diff --git a/app/Console/Commands/CatalogScanAll.php b/app/Console/Commands/CatalogScanAll.php index df0895b..1c721f4 100644 --- a/app/Console/Commands/CatalogScanAll.php +++ b/app/Console/Commands/CatalogScanAll.php @@ -49,8 +49,9 @@ class CatalogScanAll extends Command Log::info('Scanning disk: '.Storage::disk('nas')->path('')); $c = 0; + $dirs = Storage::disk('nas')->directories($class::dir_prefix()); // Scan files in dir, and make sure file lives in DB, (touch it if it does), otherwise create it - foreach (Storage::disk('nas')->directories($class::dir_prefix()) as $dir) { + foreach ($dirs as $dir) { Log::info(sprintf(' - DIR: %s',$dir)); // Take x files at a time and check the DB diff --git a/app/Models/Photo.php b/app/Models/Photo.php index a4bd42c..22659c1 100644 --- a/app/Models/Photo.php +++ b/app/Models/Photo.php @@ -235,6 +235,9 @@ class Photo extends Abstracted\Catalog */ public function image(): ?string { + if (! $this->o) + return NULL; + $imo = clone($this->o); return $imo ? $this->rotate($imo) : NULL; diff --git a/routes/web.php b/routes/web.php index 5a11791..b3db7f6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,7 +39,7 @@ Route::post('/p/undelete/{o}',[PhotoController::class,'undelete']) Route::post('/v/undelete/{o}',[VideoController::class,'undelete']) ->where('o','[0-9]+'); -Route::redirect('/','login'); +Route::redirect('/','home'); Route::get('/login',[LoginController::class,'showLoginForm']) ->name('login'); \ No newline at end of file