more seeders, drop-down for profile
This commit is contained in:
1 parent
3ccc525313
commit
a4a36087e4
6 files changed
+66
-3
No files matched your search
@@ -21,7 +21,8 @@ class ConvertToComic implements ShouldQueue
|
||||
{
|
||||
$absolutePath = Storage::disk('public')->path($this->photoJob->image_path);
|
||||
|
||||
$photoprofile = Photoprofile::where('active', 1)->first();
|
||||
$photoprofile = $this->photoJob->photoprofile
|
||||
?? Photoprofile::where('active', 1)->first();
|
||||
$photocommands = [];
|
||||
foreach (explode(PHP_EOL, $photoprofile->commands) as $command) {
|
||||
if (count($photocommands) > 0) $photocommands[] = ' && gmic ' . escapeshellarg($absolutePath) . ' ' . $command . ' -o ' . escapeshellarg($absolutePath);
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Livewire;
|
||||
|
||||
use App\Jobs\ConvertToComic;
|
||||
use App\Models\PhotoJob;
|
||||
use App\Models\Photoprofile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Livewire\Component;
|
||||
@@ -11,6 +12,12 @@ use Livewire\Component;
|
||||
class CameraCapture extends Component
|
||||
{
|
||||
public string $status = '';
|
||||
public ?int $photoprofileId = null;
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$this->photoprofileId = Photoprofile::where('active', 1)->value('id');
|
||||
}
|
||||
|
||||
public function delete(int $jobId): void
|
||||
{
|
||||
@@ -39,6 +46,7 @@ class CameraCapture extends Component
|
||||
$job = PhotoJob::create([
|
||||
'image_path' => $filename,
|
||||
'status' => 'processing',
|
||||
'photoprofile_id' => $this->photoprofileId,
|
||||
]);
|
||||
|
||||
ConvertToComic::dispatch($job);
|
||||
@@ -55,7 +63,8 @@ class CameraCapture extends Component
|
||||
]);
|
||||
|
||||
$hasProcessing = $recentPhotos->contains('status', 'processing');
|
||||
$photoprofiles = Photoprofile::where('active', 1)->pluck('name', 'id');
|
||||
|
||||
return view('livewire.camera-capture', compact('recentPhotos', 'hasProcessing'));
|
||||
return view('livewire.camera-capture', compact('recentPhotos', 'hasProcessing', 'photoprofiles'));
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,14 @@
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Photoprofile;
|
||||
|
||||
class PhotoJob extends Model
|
||||
{
|
||||
protected $fillable = ['image_path', 'status'];
|
||||
protected $fillable = ['image_path', 'status', 'photoprofile_id'];
|
||||
|
||||
public function photoprofile()
|
||||
{
|
||||
return $this->belongsTo(Photoprofile::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user