From 10a1aceeb3b04209cac53ff66409ea4ff89771fe Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 17 Sep 2024 23:07:00 +1000 Subject: [PATCH] Fix scanall, was only scanning one dir. Default route is now /home. Fix 500 error for when displaying an image that doesnt exist --- app/Console/Commands/CatalogScanAll.php | 2 -- app/Models/Photo.php | 3 +++ composer.json | 1 - routes/web.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/CatalogScanAll.php b/app/Console/Commands/CatalogScanAll.php index df0895b..60ebd54 100644 --- a/app/Console/Commands/CatalogScanAll.php +++ b/app/Console/Commands/CatalogScanAll.php @@ -112,8 +112,6 @@ class CatalogScanAll extends Command $c++; } } - - break; } Log::info('Checking for missing files'); 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/composer.json b/composer.json index c5b509d..dd51627 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,6 @@ "ext-fileinfo": "*", "ext-pdo": "*", "ext-imagick": "*", - "ext-pgsql": "*", "laravel/framework": "^11.0", "laravel/ui": "^4.5", "leenooks/laravel": "^11.1", 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