2019-05-11 23:23:27 +02:00
|
|
|
@page
|
2020-12-21 21:31:18 +01:00
|
|
|
@using System.IO
|
2019-05-11 23:23:27 +02:00
|
|
|
@model IndexModel
|
|
|
|
@{
|
2020-12-21 20:42:29 +01:00
|
|
|
ViewData["Title"] = $"webmusic on .NET {Environment.Version}";
|
2019-05-11 23:23:27 +02:00
|
|
|
}
|
2020-12-21 20:42:29 +01:00
|
|
|
@if (Model.Path.Contains("/..")) {
|
|
|
|
return;
|
2019-05-11 23:23:27 +02:00
|
|
|
}
|
2020-12-21 20:42:29 +01:00
|
|
|
@if (Model.Path.EndsWith(".lrc")) {
|
|
|
|
<h3>@Model.Path</h3>
|
|
|
|
<p>@Html.Raw((await System.IO.File.ReadAllTextAsync("music" + Model.Path)).Replace("\n", "<br/>"))</p>
|
2019-08-12 20:16:33 +02:00
|
|
|
}
|
2020-12-21 20:42:29 +01:00
|
|
|
else {
|
|
|
|
<h2>
|
2021-03-21 18:04:15 +01:00
|
|
|
@Model.Displaypath <span id="state"></span> <span id="flags">[<span id="repeatButton">R</span><span id="continuousButton">C</span>]</span>
|
2020-12-21 20:42:29 +01:00
|
|
|
</h2>
|
|
|
|
<a class="action-muted">[..]</a>
|
2021-03-06 14:47:36 +01:00
|
|
|
<a href="?@Model.PathOneup" id="back" class="entry-muted cfont"> Go back</a>
|
2020-12-21 20:42:29 +01:00
|
|
|
<br/>
|
|
|
|
<a class="action-muted">[--]</a>
|
|
|
|
<a href="/playlist/@(Request.QueryString).m3u" class="entry-muted cfont"> Download playlist</a>
|
|
|
|
<br/>
|
|
|
|
<br/>
|
|
|
|
@foreach (var dir in Model.Dirs) {
|
2021-03-06 14:47:36 +01:00
|
|
|
<li>
|
2020-12-21 20:42:29 +01:00
|
|
|
<a class="action" href="#">[--]</a>
|
2021-03-21 18:04:15 +01:00
|
|
|
<a class="dir" href="?@Model.Path/@dir"> @dir</a>
|
2021-03-06 14:47:36 +01:00
|
|
|
</li>
|
2020-12-21 20:42:29 +01:00
|
|
|
}
|
|
|
|
@foreach (var file in Model.Files) {
|
|
|
|
var jspath = IndexModel.Encode(Model.Fullpath);
|
|
|
|
var jsfile = jspath + "/" + IndexModel.Encode(file);
|
|
|
|
var basename = System.IO.Path.GetFileNameWithoutExtension(file);
|
|
|
|
var lrcfile = basename + ".lrc";
|
|
|
|
var lrcpath = System.IO.Path.Combine(Model.Fullpath, lrcfile);
|
|
|
|
|
2021-03-06 14:47:36 +01:00
|
|
|
<li>
|
2020-12-21 20:42:29 +01:00
|
|
|
<a class="action" href="@Html.Raw(IndexModel.Encode(Model.Fullpath + "/" + file))" download>[DL]</a>
|
|
|
|
@if (System.IO.File.Exists(lrcpath)) {
|
|
|
|
<a class="action" href="?@Model.Path/@lrcfile" target="_blank">[LRC]</a>
|
|
|
|
}
|
2020-12-21 21:31:18 +01:00
|
|
|
else if(Directory.GetFiles(@Model.Fullpath, "*.lrc").Length != 0) {
|
2020-12-21 21:29:41 +01:00
|
|
|
<a class="action">[---]</a>
|
2020-12-21 21:28:07 +01:00
|
|
|
}
|
2021-03-21 18:04:15 +01:00
|
|
|
<a class="file" href="@Html.Raw(IndexModel.Encode(Model.Fullpath + "/" + file))"> @file</a>
|
2021-03-06 14:47:36 +01:00
|
|
|
</li>
|
2020-12-21 20:42:29 +01:00
|
|
|
}
|
2021-03-06 14:47:36 +01:00
|
|
|
}
|