Improve log display
This commit is contained in:
parent
9f595e98a3
commit
08a945c80b
|
@ -4,7 +4,7 @@
|
|||
@model IndexModel
|
||||
@{
|
||||
if (Model.LogConditionsMet)
|
||||
ViewData["Title"] = $"{HttpUtility.UrlDecode(Model.LogArtist)} - {HttpUtility.UrlDecode(Model.LogAlbum)} ~ webmusic on .NET {Environment.Version}";
|
||||
ViewData["Title"] = $"{Model.LogDisplay} ~ webmusic on .NET {Environment.Version}";
|
||||
else
|
||||
ViewData["Title"] = $"{Model.Displaypath} ~ webmusic on .NET {Environment.Version}";
|
||||
}
|
||||
|
|
|
@ -9,19 +9,20 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
|
|||
|
||||
namespace webmusic.Pages {
|
||||
public class IndexModel : PageModel {
|
||||
private const string Root = "music";
|
||||
public List<string> Dirs = new();
|
||||
public string Displaypath = "";
|
||||
public List<string> Files = new();
|
||||
public string Fullpath = "";
|
||||
public string Path = "";
|
||||
public string PathOneup = "";
|
||||
public bool LogConditionsMet;
|
||||
public string LogArtist;
|
||||
public string LogAlbum;
|
||||
public string LogUrl;
|
||||
public string CopyArtist;
|
||||
public string CopyAlbum;
|
||||
private const string Root = "music";
|
||||
public List<string> Dirs = new();
|
||||
public string Displaypath = "";
|
||||
public List<string> Files = new();
|
||||
public string Fullpath = "";
|
||||
public string Path = "";
|
||||
public string PathOneup = "";
|
||||
public bool LogConditionsMet;
|
||||
public string LogArtist;
|
||||
public string LogAlbum;
|
||||
public string LogDisplay;
|
||||
public string LogUrl;
|
||||
public string CopyArtist;
|
||||
public string CopyAlbum;
|
||||
|
||||
public void OnGet() {
|
||||
if (Request.QueryString.HasValue)
|
||||
|
@ -56,6 +57,7 @@ namespace webmusic.Pages {
|
|||
CopyArtist = pathparts[Index.FromEnd(2)].Replace("'", "\\'");;
|
||||
LogAlbum = HttpUtility.UrlPathEncode(pathparts[Index.FromEnd(1)]).Replace("'", "\\'").Replace("&", "%26");
|
||||
LogArtist = HttpUtility.UrlPathEncode(pathparts[Index.FromEnd(2)]).Replace("'", "\\'").Replace("&", "%26");
|
||||
LogDisplay = $"{pathparts[Index.FromEnd(2)]} - {pathparts[Index.FromEnd(1)]}";
|
||||
LogUrl = Request.GetEncodedUrl().Replace("'", "\\'").Replace("&", "%26");
|
||||
LogConditionsMet = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue