From c8d1ac79719ff71c2e61ab8e53fe640e25a20ecf Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Mon, 12 Jan 2026 20:40:40 +0100 Subject: [PATCH] Improve uploader client connection and diagnostics --- .../Api/PhotoboothConnectController.php | 25 +++ .../Assets/sample-upload.png | Bin 0 -> 67 bytes .../PhotoboothUploader/MainWindow.axaml | 12 ++ .../PhotoboothUploader/MainWindow.axaml.cs | 164 +++++++++++++++++- .../Models/PhotoboothConnectResponse.cs | 3 + .../Models/PhotoboothSettings.cs | 3 + .../PhotoboothUploader.csproj | 1 + .../Services/PhotoboothConnectClient.cs | 98 +++++++++-- .../Services/UploadService.cs | 13 ++ .../Photobooth/PhotoboothConnectCodeTest.php | 2 + 10 files changed, 306 insertions(+), 15 deletions(-) create mode 100644 clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png diff --git a/app/Http/Controllers/Api/PhotoboothConnectController.php b/app/Http/Controllers/Api/PhotoboothConnectController.php index d1c9ddf..678601f 100644 --- a/app/Http/Controllers/Api/PhotoboothConnectController.php +++ b/app/Http/Controllers/Api/PhotoboothConnectController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use App\Http\Requests\Photobooth\PhotoboothConnectRedeemRequest; +use App\Models\Event; use App\Services\Photobooth\PhotoboothConnectCodeService; use Illuminate\Http\JsonResponse; @@ -33,6 +34,7 @@ class PhotoboothConnectController extends Controller return response()->json([ 'data' => [ + 'event_name' => $this->resolveEventName($event), 'upload_url' => route('api.v1.photobooth.upload'), 'username' => $setting->username, 'password' => $setting->password, @@ -42,4 +44,27 @@ class PhotoboothConnectController extends Controller ], ]); } + + private function resolveEventName(?Event $event): ?string + { + if (! $event) { + return null; + } + + $name = $event->name; + + if (is_string($name) && trim($name) !== '') { + return $name; + } + + if (is_array($name)) { + foreach ($name as $value) { + if (is_string($value) && trim($value) !== '') { + return $value; + } + } + } + + return $event->slug ?: null; + } } diff --git a/clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png b/clients/photobooth-uploader/PhotoboothUploader/Assets/sample-upload.png new file mode 100644 index 0000000000000000000000000000000000000000..fef19157c73d7e7763f2fc9f82c129fe0bae6fd3 GIT binary patch literal 67 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6UAQ@H$MqV!6EkIEQ MPgg&ebxsLQ05A^