2019-05-11 23:23:27 +02:00
|
|
|
@page
|
|
|
|
@using System.Web
|
|
|
|
@model IndexModel
|
|
|
|
@{
|
2020-12-21 16:23:56 +01:00
|
|
|
ViewData["Title"] = $"webmusic on .NET {Environment.Version}";
|
2019-08-12 20:16:33 +02:00
|
|
|
var path = HttpUtility.UrlDecode(Request.QueryString.Value.TrimStart('?'));
|
|
|
|
if (path.EndsWith(".m3u"))
|
|
|
|
{
|
|
|
|
Layout = null;
|
|
|
|
Response.ContentType = "text/plain";
|
|
|
|
}
|
2019-05-11 23:23:27 +02:00
|
|
|
}
|
2020-10-18 23:07:16 +02:00
|
|
|
@if (Model.path.Contains("/.."))
|
2019-05-11 23:23:27 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2019-08-12 20:16:33 +02:00
|
|
|
@if (path.EndsWith(".m3u"))
|
|
|
|
{
|
|
|
|
@foreach (var file in Model.files)
|
|
|
|
{
|
2020-03-22 14:07:08 +01:00
|
|
|
@Html.Raw("https://" + Request.Host + "/" + Model.fullpath + "/" + file.Replace("?", "%3F") +"\n")
|
2019-08-12 20:16:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-05-11 23:23:27 +02:00
|
|
|
<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>
|
2020-08-19 03:09:09 +02:00
|
|
|
<a href="/playlist/@(Request.QueryString).m3u" class="entry-muted cfont"> Download playlist</a><br/><br/>
|
2019-08-12 20:16:33 +02:00
|
|
|
@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>
|
2019-08-14 01:21:45 +02:00
|
|
|
<a class="action" href="@Html.Raw(Model.Encode(Model.fullpath+"/"+file))" download>[DL]</a>
|
2019-08-12 20:16:33 +02:00
|
|
|
<a href="#" onclick="playSong('@Html.Raw(jsfile)')"> @file</a>
|
|
|
|
<br/>
|
|
|
|
}
|
2019-05-11 23:23:27 +02:00
|
|
|
}
|