Search results now carry a small thumbnail, so the artwork downloaded when a YouTube track is saved would have shrunk with them. The URL is upsized to the configured artwork resolution right before the download event goes out.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using ErrorOr;
|
|
|
|
namespace Musify.Application.Contracts
|
|
{
|
|
public record YouTubeArtistRef(string? Id, string Name);
|
|
|
|
public record YouTubeSongResult(
|
|
string VideoId,
|
|
string Title,
|
|
string Artist,
|
|
string Album,
|
|
int DurationSeconds,
|
|
string ThumbnailUrl,
|
|
bool IsExplicit,
|
|
IReadOnlyList<YouTubeArtistRef> Artists);
|
|
|
|
public record YouTubeSearchResult(
|
|
IReadOnlyList<YouTubeSongResult> Items,
|
|
string ContinuationToken);
|
|
|
|
public record YouTubeStreamInfo(string Url, int ExpiresInSeconds);
|
|
|
|
public interface IYouTubeMusicService
|
|
{
|
|
Task<ErrorOr<YouTubeSearchResult>> SearchSongsAsync(string query, string continuationToken, CancellationToken cancellationToken);
|
|
|
|
Task<ErrorOr<YouTubeStreamInfo>> GetAudioStreamAsync(string videoId, CancellationToken cancellationToken);
|
|
|
|
Task<ErrorOr<YouTubeSongResult>> GetSongAsync(string videoId, CancellationToken cancellationToken);
|
|
|
|
string ResolveArtworkUrl(string thumbnailUrl);
|
|
}
|
|
}
|