aboutsummaryrefslogtreecommitdiff
path: root/resources/views/pages/music.blade.php
diff options
context:
space:
mode:
authorFrankie B <git@diskfloppy.me>2024-06-11 18:02:01 +0100
committerGitHub <noreply@github.com>2024-06-11 18:02:01 +0100
commit0f52d80ca67a49258b235f5831163dd72fbd54cf (patch)
tree9c5cd36b6e0a233e09ac88a4409fb68c63e4781a /resources/views/pages/music.blade.php
parenta64bcc2c4639d5804b6dada23151bfcb8b198121 (diff)
Merge MVC rewrite into master (#21)
* Just commit it all * Require auth * crap * Update homepage * Block AI scrapers * Update cache update script * Add dummy file * Remove unnecessary lastfm config var * Use withQueryParameters for LastFM API * Fix embeds * Update example env * Smard
Diffstat (limited to 'resources/views/pages/music.blade.php')
-rw-r--r--resources/views/pages/music.blade.php66
1 files changed, 0 insertions, 66 deletions
diff --git a/resources/views/pages/music.blade.php b/resources/views/pages/music.blade.php
deleted file mode 100644
index dba0750..0000000
--- a/resources/views/pages/music.blade.php
+++ /dev/null
@@ -1,66 +0,0 @@
-@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'];
-
- $api_alive = true;
-
- try {
- $data = file_get_contents($api_root.'/lastfm/current');
- } catch (Exception $e) {
- $api_alive = false;
- }
- @endphp
- @if (!$api_alive)
- @include('components.errors.api-error')
- @else
-
- @php
- $current_track = json_decode(file_get_contents($api_root . '/lastfm/current'));
- $top_tracks = json_decode(file_get_contents($api_root . '/lastfm/top'));
- $count = 0;
- @endphp
- <table class="info-table" role="presentation" width="100%">
- <tr>
- <td colspan="4">
- <h2>Last/Current Track:</h2>
- </td>
- </tr>
- <tr>
- <td colspan="4">
- <a href="{{ $current_track->url }}">{{ $current_track->title }} • {{ $current_track->artist }}</a><br>
- </td>
- </tr>
- </table>
- <hr>
- <table class="music-top10">
- <tr>
- <td colspan="4">
- <h2 style="margin-bottom: 5px">Top {{ $cfg['toptracks'] }} Tracks (Last 7 days)</h2>
- </td>
- </tr>
- <tr>
- <td style="text-align: right"><b>#</b></td>
- <td><b>Track</b></td>
- <td><b>Artist</b></td>
- <td><b>Plays</b></td>
- </tr>
- @foreach ($top_tracks as $track)
- @php $count++ @endphp
- @if ($count >= $cfg['toptracks']+1)
- @break
- @endif
- <tr>
- <td style="text-align: right">{{ $count }}</td>
- <td style="white-space: nowrap; text-overflow:ellipsis; overflow: hidden; max-width:1px;" width="50%"><a href="{{ $track->url }}">{{ $track->title }}</a></td>
- <td style="white-space: nowrap; text-overflow:ellipsis; overflow: hidden; max-width:1px;" width="50%">{{ $track->artist }}</td>
- <td>{{ $track->playcount }}</td>
- </tr>
- @endforeach
- </table>
- @endif
-@stop