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

@@ -4,9 +4,12 @@ namespace App\Models;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Traits\ForwardsCalls;
use Imagick;
use App\Jobs\CatalogMove;
class Photo extends Abstracted\Catalog
{
use ForwardsCalls;
@@ -28,11 +31,26 @@ class Photo extends Abstracted\Catalog
// How should the image be rotated, based on the value of orientation
private array $_rotate = [
3=>180,
6=>90,
8=>-90,
3 => 180,
6 => 90,
8 => -90,
];
public static function boot()
{
parent::boot();
// Any photo saved, queue it to be moved.
self::saved(function($item) {
if ($item->scanned && (! $item->duplicate) && (! $item->remove) && ($x=$item->shouldMove()) === TRUE) {
Log::info(sprintf('%s: Need to Move [%s]','Photo',$item->id.'|'.serialize($x)));
CatalogMove::dispatch($item)
->onQueue('move');
}
});
}
/**
* Calculate the GPS coordinates
*/