From a7b369d9886a547075058f7ada231b14badaf059 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Fri, 28 Jul 2023 23:42:17 +0100 Subject: Add music page --- resources/views/pages/music.blade.php | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 resources/views/pages/music.blade.php (limited to 'resources') diff --git a/resources/views/pages/music.blade.php b/resources/views/pages/music.blade.php new file mode 100644 index 0000000..cba45c2 --- /dev/null +++ b/resources/views/pages/music.blade.php @@ -0,0 +1,55 @@ +@extends('layouts.default') +@section('title', 'Music') +@section('description', '') +@section('content') + @php + + $cfg = app('config')->get('services')['lastfm']; + $api_root = app('config')->get('app')['api_root']; + + $current_track = json_decode(file_get_contents($api_root . '/lastfm/current')); + $toptracks = json_decode(file_get_contents($api_root . '/lastfm/top')); + $count = 0; + @endphp + + + + + + + + + + + + + + + + + + + + @foreach ($toptracks as $track) + @php $count++ @endphp + @if ($count >= $cfg['toptracks']) + @break + @endif + + + + + + + @endforeach +
+

Last/Current Track:

+
+ {{ $current_track->name }} • {{ $current_track->artist }}
+
+
+
+

Top {{ $cfg['toptracks'] }} Tracks (Last 7 days)

+
#TrackArtistPlays
{{ $count+1 }}{{ $track->name }}{{ $track->artist }}{{ $track->plays }}
+
+@stop -- cgit v1.2.3-54-g00ecf