From 49f9f7fd3c87e84667c28b55974367170510597c Mon Sep 17 00:00:00 2001 From: Roscoe Date: Sat, 30 Aug 2025 17:44:33 +0100 Subject: [PATCH] fuck it, just do it in the blade template instead --- app/View/Components/LastFMCurrent.php | 10 ---------- config/app.php | 2 +- .../views/components/lastfm-current.blade.php | 15 +++++++++++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/View/Components/LastFMCurrent.php b/app/View/Components/LastFMCurrent.php index e62554f..ebe029b 100644 --- a/app/View/Components/LastFMCurrent.php +++ b/app/View/Components/LastFMCurrent.php @@ -8,21 +8,11 @@ class LastFMCurrent extends Component { public $track; - public $artUrl; /** * Create a new component instance. */ public function __construct($track) { $this->track = $track; - $this->artUrl = null; - if (isLegacy()) { - $path = parse_url($track["image"], PHP_URL_PATH); - if ($track["image"] !== "") { - $this->artUrl = "//" . request()->getHttpHost() . "/proxy/lastfm/" . basename($path); - } - } else { - $this->artUrl = $track["image"]; - } } /** diff --git a/config/app.php b/config/app.php index 606c8d2..8249935 100644 --- a/config/app.php +++ b/config/app.php @@ -5,7 +5,7 @@ return [ 'name' => env('APP_NAME', 'wah.moe'), - 'version' => '2025.08.30-patch0', + 'version' => '2025.08.30-patch1', 'env' => env('APP_ENV', 'production'), 'debug' => (bool) env('APP_DEBUG', false), 'url' => env('APP_URL', 'http://localhost'), diff --git a/resources/views/components/lastfm-current.blade.php b/resources/views/components/lastfm-current.blade.php index e78ae26..230a07a 100644 --- a/resources/views/components/lastfm-current.blade.php +++ b/resources/views/components/lastfm-current.blade.php @@ -1,7 +1,14 @@ @if (isLegacy()) + @php + $artUrl = null; + $path = parse_url($track["image"], PHP_URL_PATH); + if ($track["image"] !== "") { + $artUrl = "//" . request()->getHttpHost() . "/proxy/lastfm/" . basename($path); + } + @endphp - @if (isset($artUrl)) - + @if ($artUrl !== null) + @endif
Album cover for {{ $track[Album cover for {{ $track[  @@ -13,9 +20,9 @@
@else
- @if (isset($artUrl)) + @if($track["image"] !== "")
- Album cover for {{ $track[ + Album cover for {{ $track[
@endif