webmusic/Pages/Index.cshtml
Laura d9c776e1d1
Initial commit
fix repeat
added simple keyboard control
add preloading tracks
add plain view ("api")
fix memory leak, add streaming
responsive viewport
Mobile web capable
2019-07-06 03:59:58 +02:00

31 lines
958 B
Plaintext

@page
@using System.Web
@model IndexModel
@{
ViewData["Title"] = "webmusic";
}
@if (Model.path.Contains(".."))
{
return;
}
<h2>@Model.displaypath <span id="state"></span> <span id="flags"></span></h2>
<a class="action-muted">[..]</a>
<a href="?@Model.path_oneup" class="entry-muted cfont"> Go back</a><br/>
<a class="action-muted">[--]</a>
<a href="#" onclick="downloadm3u()" class="entry-muted cfont"> Download m3u</a><br/><br/>
@foreach (var dir in Model.dirs)
{
<a class="action" href="#">[--]</a>
<a href="?@Model.path/@dir"> @dir</a>
<br/>
}
@foreach (var file in Model.files)
{
var jspath = Model.Encode(Model.fullpath);
var jsfile = jspath + "/" + Model.Encode(file);
<script>queue.push('@Html.Raw(jsfile)')</script>
<a class="action" href="@Html.Raw(Model.Encode(Model.fullpath+"/"+file))" download>[DL]</a>
<a href="#" onclick="playSong('@Html.Raw(jsfile)')"> @file</a>
<br/>
}