1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(zaatar): clean up mpd

This commit is contained in:
2021-01-27 00:03:32 +01:00
parent 422f2b8676
commit 38f088d9e5
6 changed files with 4 additions and 509 deletions

View File

@@ -1,64 +0,0 @@
{ pkgs, playlists }:
let
inherit (pkgs) lib;
trackHTML = {url, provider, name}: ''
<tr>
<th>${name}</th>
<td><small>${provider}</small></td>
<td>
<audio controls>
<source src="${url}">
Your browser does not support the audio tag.
</audio>
</td>
</tr>
'';
playlistSection = name: {description, tracks}: ''
<section>
<header>
<h2 id="${lib.strings.sanitizeDerivationName name}">${name}</h2>
<p>${description}</p>
</header>
<table>
<thead>
<th>Name</th>
<th>Provider</th>
<th>Player</th>
</thead>
${builtins.concatStringsSep "\n\n" (map trackHTML tracks)}
</table>
</section>
'';
in pkgs.writeText "tuner.html" ''
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tuner</title>
<link rel="stylesheet" href="https://unpkg.com/mvp.css">
</head>
<body>
<header>
<nav>
<a href="#">Tuner</a>
<small>kmein's webradio hub</small>
<ul>
<li>
Playlists
<ul>
${builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: {...}: ''<li><a href="#${lib.strings.sanitizeDerivationName name}">${name}</a></li>'') playlists)}
</ul>
</li>
</ul>
</nav>
</header>
<main>
${builtins.concatStringsSep "\n<hr/>\n" (lib.mapAttrsToList playlistSection playlists)}
</main>
<footer>
<p><small>&copy; kmein 2020</small></p>
</footer>
</body>
</html>
''