Photo scan and move implemented, and remove redundant files
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user