доработка api поиска треков

This commit is contained in:
FrigaT
2026-04-16 16:58:06 +03:00
parent 974fb0f538
commit 68d7c7fc12
20 changed files with 191 additions and 56 deletions

View File

@@ -4,14 +4,16 @@ namespace PlaylistShared.Api.Extensions;
public static class YCoverExtensions
{
public static string GetUrl(this YCover cover, string size = "200x200")
public static string GetUrl(this YCover cover)
{
switch (cover)
{
case YCoverImage img when !string.IsNullOrEmpty(img.Uri):
return $"https://{img.Uri.Replace("%%", size)}";
return img.Uri;
case YCoverPic pic when !string.IsNullOrEmpty(pic.Uri):
return $"https://{pic.Uri.Replace("%%", size)}";
return pic.Uri;
case YCoverMosaic mosaic when mosaic.ItemsUri.Any():
return mosaic.ItemsUri.First();
default:
return string.Empty;
}