Hide album art if not available

This commit is contained in:
Roscoe 2025-08-29 23:45:32 +01:00
commit a4edd396f0
Signed by: RoscoeDaWah
SSH key fingerprint: SHA256:Hqn452XQ1ETzUt/FthJu6+OFkS4NBxCv5VQSEvuk7CE
2 changed files with 7 additions and 1 deletions

View file

@ -16,6 +16,10 @@ public function __construct($track) {
$this->track = $track;
if (isLegacy()) {
$path = parse_url($track["image"], PHP_URL_PATH);
if ($track["image"] === "") {
$this->artUrl = null;
return;
}
$this->artUrl = "//".request()->getHttpHost()."/proxy/lastfm/".basename($path);
} else {
$this->artUrl = $track["image"];

View file

@ -1,6 +1,8 @@
@if (isLegacy())
<table border="0" cellpadding="0" cellspacing="0"><tr>
<td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}"></td>
@if ($artUrl !== null)
<td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}"></td>
@endif
<td width="10px">&nbsp;</td>
<td>
<h2>{{ $track["header"] }}:</h2>