Photo scan and move implemented, and remove redundant files

This commit is contained in:
2024-09-02 22:51:19 +10:00
parent 431ceec69f
commit a3013078e0
13 changed files with 131 additions and 479 deletions

View File

@@ -22,7 +22,7 @@ abstract class Catalog extends Model
'thumbnail' => PostgresBytea::class,
];
protected const fs = 'nas';
public const fs = 'nas';
private ?string $move_reason;
@@ -271,7 +271,12 @@ abstract class Catalog extends Model
} else
return Storage::disk(self::fs)
->path(config(static::config.'.dir').DIRECTORY_SEPARATOR.$this->filename);
->path($this->file_name_rel());
}
public function file_name_rel(bool $source=TRUE): string
{
return config(static::config.'.dir').DIRECTORY_SEPARATOR.($source ? $this->filename : $this->file_name());
}
/**
@@ -285,7 +290,7 @@ abstract class Catalog extends Model
if ($new)
$file = $this->file_name(TRUE);
return (($short OR preg_match('/^\//',$file)) ? '' : config($this->type.'.dir').DIRECTORY_SEPARATOR).$file;
return (($short OR preg_match('/^\//',$file)) ? '' : config(static::config.'.dir').DIRECTORY_SEPARATOR).$file;
}
/**
@@ -507,18 +512,6 @@ abstract class Catalog extends Model
return is_readable($this->file_name(FALSE));
}
/**
* Determine if a file is moveable
*
* useID boolean Determine if the path is based on the the ID or date
* @todo Change to boolean and rename isMoveable() Log any FALSE reason.
*/
public function moveable()
{
Log::alert(__METHOD__.' deprecated');
return $this->isMoveable();
}
/**
* Get the id of the next record
*/