diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 0e7cd41..7fe955d 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -43,7 +43,7 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=ref,event=tag - type=raw,value=latest,enable=${{ !github.event.release.prerelease }} + type=raw,value=latest,enable=${{ github.event.release.prerelease == false }} - name: Build and push Docker image uses: docker/build-push-action@v6 diff --git a/app/Models/PlaylistItem.php b/app/Models/PlaylistItem.php index 3040e39..2459257 100644 --- a/app/Models/PlaylistItem.php +++ b/app/Models/PlaylistItem.php @@ -135,13 +135,10 @@ class PlaylistItem extends Model /** * Render all plugins with appropriate layout */ - public function render(?Device $device = null): string + public function render(): string { if (! $this->isMashup()) { return view('trmnl-layouts.single', [ - 'colorDepth' => $device?->deviceModel?->color_depth, - 'deviceVariant' => $device?->deviceModel?->name ?? 'og', - 'scaleLevel' => $device?->deviceModel?->scale_level, 'slot' => $this->plugin instanceof Plugin ? $this->plugin->render('full', false) : throw new Exception('Invalid plugin instance'), @@ -163,9 +160,6 @@ class PlaylistItem extends Model } return view('trmnl-layouts.mashup', [ - 'colorDepth' => $device?->deviceModel?->color_depth, - 'deviceVariant' => $device?->deviceModel?->name ?? 'og', - 'scaleLevel' => $device?->deviceModel?->scale_level, 'mashupLayout' => $this->getMashupLayoutType(), 'slot' => implode('', $pluginMarkups), ])->render(); diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php index 8f0ec75..382751d 100644 --- a/app/Models/Plugin.php +++ b/app/Models/Plugin.php @@ -343,22 +343,12 @@ class Plugin extends Model } if ($standalone) { - if ($size === 'full') { - return view('trmnl-layouts.single', [ - 'colorDepth' => $device?->deviceModel?->color_depth, - 'deviceVariant' => $device?->deviceModel?->name ?? 'og', - 'scaleLevel' => $device?->deviceModel?->scale_level, - 'slot' => $renderedContent, - ])->render(); - } else { - return view('trmnl-layouts.mashup', [ - 'mashupLayout' => $this->getPreviewMashupLayoutForSize($size), - 'colorDepth' => $device?->deviceModel?->color_depth, - 'deviceVariant' => $device?->deviceModel?->name ?? 'og', - 'scaleLevel' => $device?->deviceModel?->scale_level, - 'slot' => $renderedContent, - ])->render(); - } + return view('trmnl-layouts.single', [ + 'colorDepth' => $device?->deviceModel?->color_depth, + 'deviceVariant' => $device?->deviceModel?->name ?? 'og', + 'scaleLevel' => $device?->deviceModel?->scale_level, + 'slot' => $renderedContent, + ])->render(); } return $renderedContent; @@ -396,13 +386,4 @@ class Plugin extends Model { return $this->configuration[$key] ?? $default; } - - public function getPreviewMashupLayoutForSize(string $size): string - { - return match ($size) { - 'half_vertical' => '1Lx1R', - 'quadrant' => '2x2', - default => '1Tx1B', - }; - } } diff --git a/routes/api.php b/routes/api.php index 8adc404..578fe7d 100644 --- a/routes/api.php +++ b/routes/api.php @@ -110,7 +110,7 @@ Route::get('/display', function (Request $request) { } } - $markup = $playlistItem->render(device: $device); + $markup = $playlistItem->render(); GenerateScreenJob::dispatchSync($device->id, null, $markup); $device->refresh();