Improve log display

This commit is contained in:
Laura Hausmann 2023-11-05 14:13:04 +01:00
parent 9f595e98a3
commit 08a945c80b
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 16 additions and 14 deletions

View file

@ -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}";
}

View file

@ -19,6 +19,7 @@ namespace webmusic.Pages {
public bool LogConditionsMet;
public string LogArtist;
public string LogAlbum;
public string LogDisplay;
public string LogUrl;
public string CopyArtist;
public string CopyAlbum;
@ -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;
}