Вынесена логика формирования обложки

This commit is contained in:
FrigaT
2026-04-14 19:03:11 +03:00
parent e0fca7e55e
commit acf02c85a7
5 changed files with 24 additions and 22 deletions

View File

@@ -30,7 +30,7 @@
}
else
{
<MudImage Src="@FormatCoverUrl(context.CoverUri, "50x50")" Height="50" Width="50" Class="rounded" />
<MudImage Src="@context.CoverUri.FormatCoverUrl(50, 50)" Height="50" Width="50" Class="rounded" />
}
}
</MudTd>
@@ -141,12 +141,6 @@
await OnPlayTrack.InvokeAsync(trackId);
}
private string FormatCoverUrl(string? url, string size)
{
if (string.IsNullOrEmpty(url)) return "";
return "https://" + url.Replace("%%", size);
}
private string FormatDuration(long ms)
{
var seconds = ms / 1000;