Compare commits

...

8 commits

Author SHA1 Message Date
fd82adc73e
Filter out flagged entries in the original query 2025-08-31 03:35:48 +01:00
49f9f7fd3c
fuck it, just do it in the blade template instead 2025-08-30 17:45:44 +01:00
288fe04e95
update deps 2025-08-30 17:43:56 +01:00
800898153d
temp "fix" 2025-08-30 05:01:29 +01:00
79d8294ba1
fix??????? 2025-08-30 04:57:18 +01:00
c89bf3bf1a
fix???? 2025-08-30 04:55:26 +01:00
ce45727b60
fix maybe 2025-08-30 04:46:17 +01:00
7ba32186cf
Dont show album art if url not defined 2025-08-30 04:34:41 +01:00
7 changed files with 255 additions and 212 deletions

View file

@ -25,7 +25,7 @@ public function getCurrentTrack() {
$data = $response->json(); $data = $response->json();
$track_data = $data["recenttracks"]["track"][0]; $track_data = $data["recenttracks"]["track"][0];
// $image = array_column($track_data["image"], null, 'size')['large'] ?? false; // $image = array_column($track_data["image"], null, 'size')['large'] ?? false;
$image = $track_data["image"][(array_key_last($track_data["image"]))] ?? false; $image = end($track_data["image"]) ?? false;
$now_playing = false; $now_playing = false;
if (array_key_exists("@attr", $track_data)) { if (array_key_exists("@attr", $track_data)) {
$now_playing = $track_data["@attr"]["nowplaying"] == "true" ?? ["url"=>null]; $now_playing = $track_data["@attr"]["nowplaying"] == "true" ?? ["url"=>null];

View file

@ -29,7 +29,7 @@ public static function insertGuestbookEntry(Request $request) {
} }
public static function selectEntries() { public static function selectEntries() {
$entries = GuestbookEntry::orderBy('created_at', 'desc')->get(); $entries = GuestbookEntry::where("legacy_flagged", false)->orderBy('created_at', 'desc')->get();
return $entries; return $entries;
} }

View file

@ -8,22 +8,11 @@
class LastFMCurrent extends Component { class LastFMCurrent extends Component {
public $track; public $track;
public $artUrl;
/** /**
* Create a new component instance. * Create a new component instance.
*/ */
public function __construct($track) { public function __construct($track) {
$this->track = $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"];
}
} }
/** /**

435
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@
return [ return [
'name' => env('APP_NAME', 'wah.moe'), 'name' => env('APP_NAME', 'wah.moe'),
'version' => '2025.08.30', 'version' => '2025.08.30-patch2',
'env' => env('APP_ENV', 'production'), 'env' => env('APP_ENV', 'production'),
'debug' => (bool) env('APP_DEBUG', false), 'debug' => (bool) env('APP_DEBUG', false),
'url' => env('APP_URL', 'http://localhost'), 'url' => env('APP_URL', 'http://localhost'),

View file

@ -1,7 +1,14 @@
@if (isLegacy()) @if (isLegacy())
@php
$artUrl = null;
$path = parse_url($track["image"], PHP_URL_PATH);
if ($track["image"] !== "") {
$artUrl = "//" . request()->getHttpHost() . "/proxy/lastfm/" . basename($path);
}
@endphp
<table border="0" cellpadding="0" cellspacing="0"><tr> <table border="0" cellpadding="0" cellspacing="0"><tr>
@if ($artUrl !== null) @if ($artUrl !== null)
<td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}"></td> <td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}" border="1"></td>
@endif @endif
<td width="10px">&nbsp;</td> <td width="10px">&nbsp;</td>
<td> <td>
@ -13,9 +20,11 @@
<br> <br>
@else @else
<div class="current-track"> <div class="current-track">
@if($track["image"] !== "")
<div> <div>
<img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}"> <img src="{{ $track["image"] }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}">
</div> </div>
@endif
<div> <div>
<h2>{{ $track["header"] }}:</h2> <h2>{{ $track["header"] }}:</h2>
<a href="{{ $track["url"] }}"><font color="#000000">{{ $track["title"] }}</font></a><br> <a href="{{ $track["url"] }}"><font color="#000000">{{ $track["title"] }}</font></a><br>

View file

@ -66,8 +66,6 @@
<font size="+2"><b>Entries ({{ count($entries) }} total)</b></font> <font size="+2"><b>Entries ({{ count($entries) }} total)</b></font>
<table cellspacing="10" cellpadding="0" border="0"> <table cellspacing="10" cellpadding="0" border="0">
@foreach ($entries as $entry) @foreach ($entries as $entry)
{{-- Skip entries flagged as legacy --}}
@if($entry->legacy_flagged) @php continue @endphp @endif
@php @php
$user_agent = $parser->parse($entry->agent); $user_agent = $parser->parse($entry->agent);
@endphp @endphp