padding now title, fixing percentage play count

This commit is contained in:
Andy Pack 2023-01-26 22:06:52 +00:00
parent 66209b7ec3
commit c2abe3ae15
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
2 changed files with 12 additions and 6 deletions

View File

@ -0,0 +1,6 @@
body {
}
h1 {
padding-bottom: 20px;
}

View File

@ -9,7 +9,7 @@
Track: @Count.Track
@if (trackPercent >= 0.01)
{
<small>(@(trackPercentDisplay)%)</small>
<small> (@(trackPercentDisplay)%)</small>
}
</a>
</h5>
@ -21,7 +21,7 @@
Album: @Count.Album
@if (albumPercent >= 0.01)
{
<small>(@(albumPercentDisplay)%)</small>
<small> (@(albumPercentDisplay)%)</small>
}
</a>
</h5>
@ -33,7 +33,7 @@
Artist: @Count.Artist
@if (artistPercent >= 0.1)
{
<small>(@(artistPercentDisplay)%)</small>
<small> (@(artistPercentDisplay)%)</small>
}
</a>
</h5>
@ -63,9 +63,9 @@
private string artistLink => $"https://www.last.fm/user/{Username}/library/music/{Track.Artists.First().Name}";
private string userLink => $"https://www.last.fm/user/{Username}";
private float trackPercent => Count.Track.HasValue && Count.User.HasValue ? Count.Track.Value * 100 / Count.User.Value : 0f;
private float albumPercent => Count.Album.HasValue && Count.User.HasValue ? Count.Album.Value * 100 / Count.User.Value : 0f;
private float artistPercent => Count.Artist.HasValue && Count.User.HasValue ? Count.Artist.Value * 100 / Count.User.Value : 0f ;
private float trackPercent => Count.Track.HasValue && Count.User.HasValue ? (float) Count.Track.Value * 100 / Count.User.Value : 0f;
private float albumPercent => Count.Album.HasValue && Count.User.HasValue ? (float) Count.Album.Value * 100 / Count.User.Value : 0f;
private float artistPercent => Count.Artist.HasValue && Count.User.HasValue ? (float) Count.Artist.Value * 100 / Count.User.Value : 0f ;
private string trackPercentDisplay => string.Format("{0:#,##0.##}", trackPercent);
private string albumPercentDisplay => string.Format("{0:#,##0.##}", albumPercent);