@page
@using System.IO
@model IndexModel
@{
ViewData["Title"] = $"webmusic on .NET {Environment.Version}";
}
@if (Model.Path.Contains("/..")) {
return;
}
@if (Model.Path.EndsWith(".lrc")) {
@Model.Path
@Html.Raw((await System.IO.File.ReadAllTextAsync("music" + Model.Path)).Replace("\n", "
"))
}
else {
@Model.Displaypath
[..]
Go back
[--]
Download playlist
@foreach (var dir in Model.Dirs) {
[--]
@dir
}
@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);
[DL]
@if (System.IO.File.Exists(lrcpath)) {
[LRC]
}
else if(Directory.GetFiles(@Model.Fullpath, "*.lrc").Length != 0) {
[---]
}
@file
}
}