Move lyrics to new page
This commit is contained in:
parent
2d81029c29
commit
2522214a97
|
@ -48,7 +48,7 @@ else {
|
|||
<li>
|
||||
<a class="action" href="@Html.Raw(IndexModel.Encode(Model.Fullpath + "/" + file))" download>[DL]</a>
|
||||
@if (System.IO.File.Exists(lrcpath)) {
|
||||
<a class="action" href="?@Html.Raw(IndexModel.Encode(Model.Path + "/" + lrcfile))" target="_blank">[LRC]</a>
|
||||
<a class="action" href="/lyrics/?@Html.Raw(IndexModel.Encode(Model.Path + "/" + lrcfile))" target="_blank">[LRC]</a>
|
||||
}
|
||||
else if (Directory.GetFiles(Model.Fullpath, "*.lrc").Length != 0) {
|
||||
<a class="action">[---]</a>
|
||||
|
|
18
Pages/lyrics.cshtml
Normal file
18
Pages/lyrics.cshtml
Normal file
|
@ -0,0 +1,18 @@
|
|||
@page
|
||||
@using System.IO
|
||||
@model IndexModel
|
||||
@{
|
||||
ViewData["Title"] = $"webmusic on .NET {Environment.Version}";
|
||||
}
|
||||
@if (Model.Path.Contains("/..")) {
|
||||
return;
|
||||
}
|
||||
@if (!Model.Path.EndsWith(".lrc")) {
|
||||
Response.Redirect("/" + Request.QueryString);
|
||||
return;
|
||||
}
|
||||
@{
|
||||
Layout = "Shared/_LayoutNojs";
|
||||
}
|
||||
<h3>@Model.Path</h3>
|
||||
<p>@Html.Raw((await System.IO.File.ReadAllTextAsync("music" + Model.Path)).Replace("\n", "<br/>"))</p>
|
Loading…
Reference in a new issue