Major refactor of photo processing, video processing still to do

This commit is contained in:
2024-08-31 22:23:07 +10:00
parent 2d04c8ccbb
commit 9208ddf779
27 changed files with 3581 additions and 1017 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Providers;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Bus\DispatchesJobs;
@@ -30,12 +31,14 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
Route::model('po',Photo::class);
// Any photo saved, queue it to be moved.
Photo::saved(function($photo) {
if ($photo->scanned AND ! $photo->duplicate AND ! $photo->remove AND ($x=$photo->moveable()) === TRUE) {
if ($photo->scanned && (! $photo->duplicate) && (! $photo->remove) && ($x=$photo->moveable()) === TRUE) {
Log::info(sprintf('%s: Need to Move [%s]',__METHOD__,$photo->id.'|'.serialize($x)));
$this->dispatch((new PhotoMove($photo))->onQueue('move'));
PhotoMove::dispatch($photo)->onQueue('move');
}
});