zuletzt/src/app/views/songs/index.zmpl
mitteneer 0522a023b5 Use find() instead of where() for song/albums views and add artists to song view
I think this makes things faster, but I may just be comparing to the scrobbles view which is terribly slow
2025-03-28 10:11:07 -04:00

40 lines
No EOL
901 B
Text

<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/simple-datatables@latest/dist/style.css" rel="stylesheet" type="text/css">
<meta charset="UTF-8">
</head>
<body>
@partial partials/header
<h1>Songs</h1>
<table id="myTable">
<thead>
<tr>
<th>Name</th>
<th>Artists(s)</th>
<th>Scrobbles</th>
</tr>
</thead>
<tbody>
@for (.songs) |song| {
<tr>
<td class=cell><a href="/songs/{{song.url}}">{{song.name}}</a></td>
<td class=cell>
@for (song.get("artist_info").?) |ai| {
<a href="/artists/{{ai.id}}">{{ai.name}}</a>
}
</td>
<td class=cell>{{song.scrobbles}}</td>
</tr>
}
</tbody>
</table>
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest" type="text/javascript"></script>
<script>
const dataTable = new simpleDatatables.DataTable("#myTable", {
searchable: true,
perPage: 50,
perPageSelect: [25,50,100],
});
</script>
</body>
</html>