diff --git a/app/Http/Controllers/MusicController.php b/app/Http/Controllers/MusicController.php index 5e31d86..08a01f6 100644 --- a/app/Http/Controllers/MusicController.php +++ b/app/Http/Controllers/MusicController.php @@ -25,10 +25,12 @@ public function getCurrentTrack() { $data = $response->json(); error_log($response->body()); $track_data = $data["recenttracks"]["track"][0]; + $image = array_column($track_data["image"], null, 'size')['large'] ?? false; $current_track = [ 'title' => $track_data["name"], 'artist' => $track_data["artist"]["#text"], 'url' => $track_data["url"], + 'image' => $image["#text"], ]; Cache::put('current_track', $current_track, now()->addSeconds(15)); return $current_track; diff --git a/config/app.php b/config/app.php index 615bf7f..981759a 100644 --- a/config/app.php +++ b/config/app.php @@ -5,7 +5,7 @@ return [ 'name' => env('APP_NAME', 'diskfloppy.me'), - 'version' => '2024.12.19', + 'version' => '2024.12.20', 'env' => env('APP_ENV', 'production'), 'debug' => (bool) env('APP_DEBUG', false), 'url' => env('APP_URL', 'http://localhost'), diff --git a/public/css/master.css b/public/css/master.css index 544c9e8..90e5e9d 100644 --- a/public/css/master.css +++ b/public/css/master.css @@ -252,6 +252,19 @@ table.music-top10 tr td:first-child { background-color: var(--table-header); } +div.current-track { + display: grid; + grid-template-columns: 180px auto; + grid-template-rows: 1fr; + grid-column-gap: 10px; + align-items: center; +} + +div.current-track img { + float: left; + filter: var(--shadow-small); + border: var(--border); +} /** Bookmarks **/ div.bookmark-category:first-child h2 { diff --git a/resources/views/components/current-track.blade.php b/resources/views/components/current-track.blade.php index 50d3367..45479d8 100644 --- a/resources/views/components/current-track.blade.php +++ b/resources/views/components/current-track.blade.php @@ -1,4 +1,9 @@
-

Last/Current Track:

- {{ $track["title"] }} • {{ $track["artist"] }}
+
+ Album cover for {{ $track[ +
+
+

Last/Current Track:

+ {{ $track["title"] }} • {{ $track["artist"] }}
+