Fix scanall, was only scanning one dir. Default route is now /home. Fix 500 error for when displaying an image that doesnt exist

This commit is contained in:
Deon George 2024-09-17 23:07:00 +10:00
parent 86dceac617
commit e142615e6c
3 changed files with 6 additions and 2 deletions

View File

@ -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

View File

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

View File

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