#nullable enable using System; using System.Threading.Tasks; namespace NadekoBot.Core.Modules.Music { public sealed class RemoteTrackInfo : ITrackInfo { public string Title { get; } public string Url { get; } public string Thumbnail { get; } public TimeSpan Duration { get; } public MusicPlatform Platform { get; } private readonly Func> _streamFactory; public RemoteTrackInfo(string title, string url, string thumbnail, TimeSpan duration, MusicPlatform platform, Func> streamFactory) { _streamFactory = streamFactory; Title = title; Url = url; Thumbnail = thumbnail; Duration = duration; Platform = platform; } public async ValueTask GetStreamUrl() => await _streamFactory(); } }