Вынесена логика формирования обложки
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
@onmouseleave="HandleMouseLeave"
|
||||
style="position: relative; display: inline-block; cursor: pointer;">
|
||||
|
||||
<MudImage Src="@FormatCoverUrl(CoverUrl)" Height="@Height" Width="@Width" Class="rounded" Style="display: block;" />
|
||||
<MudImage Src="@CoverUrl.FormatCoverUrl(Width, Height)" Height="@Height" Width="@Width" Class="rounded" Style="display: block;" />
|
||||
|
||||
@if (_isHovered || IsCurrentTrackPlaying)
|
||||
{
|
||||
@@ -62,10 +62,4 @@
|
||||
{
|
||||
InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private string FormatCoverUrl(string? url)
|
||||
{
|
||||
if (string.IsNullOrEmpty(url)) return "";
|
||||
return "https://" + url.Replace("%%", $"{Width}x{Height}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user