Hide album art if not available
This commit is contained in:
parent
57bb0e03a3
commit
a4edd396f0
2 changed files with 7 additions and 1 deletions
|
@ -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"];
|
||||
|
|
|
@ -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"> </td>
|
||||
<td>
|
||||
<h2>{{ $track["header"] }}:</h2>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue