Compare commits

..

No commits in common. "master" and "v2025.08.30" have entirely different histories.

7 changed files with 212 additions and 255 deletions

View file

@ -25,7 +25,7 @@ public function getCurrentTrack() {
$data = $response->json();
$track_data = $data["recenttracks"]["track"][0];
// $image = array_column($track_data["image"], null, 'size')['large'] ?? false;
$image = end($track_data["image"]) ?? false;
$image = $track_data["image"][(array_key_last($track_data["image"]))] ?? false;
$now_playing = false;
if (array_key_exists("@attr", $track_data)) {
$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() {
$entries = GuestbookEntry::where("legacy_flagged", false)->orderBy('created_at', 'desc')->get();
$entries = GuestbookEntry::orderBy('created_at', 'desc')->get();
return $entries;
}

View file

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

435
composer.lock generated

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1,14 +1,7 @@
@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>
@if ($artUrl !== null)
<td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}" border="1"></td>
<td><img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}"></td>
@endif
<td width="10px">&nbsp;</td>
<td>
@ -20,11 +13,9 @@
<br>
@else
<div class="current-track">
@if($track["image"] !== "")
<div>
<img src="{{ $track["image"] }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}">
<img src="{{ $artUrl }}" alt="Album cover for {{ $track["title"] }} by {{ $track["artist"] }}">
</div>
@endif
<div>
<h2>{{ $track["header"] }}:</h2>
<a href="{{ $track["url"] }}"><font color="#000000">{{ $track["title"] }}</font></a><br>

View file

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