/// <summary> /// Initializes a new instance of the <see cref="LavalinkTrack"/> class. /// </summary> /// <param name="identifier">the track identifier</param> /// <param name="info">the track info</param> /// <exception cref="ArgumentNullException"> /// thrown if the specified <paramref name="identifier"/> is blank. /// </exception> public LavalinkTrack(string identifier, LavalinkTrackInfo info) : this(info) { if (string.IsNullOrWhiteSpace(identifier)) { throw new ArgumentException("The specified identifier can not be blank.", nameof(identifier)); } Identifier = identifier; }
internal LavalinkTrack(LavalinkTrackInfo info) { if (info is null) { throw new ArgumentNullException(nameof(info)); } Author = info.Author; Title = info.Title; Source = info.Source; Duration = info.Duration; IsLiveStream = info.IsLiveStream; IsSeekable = info.IsSeekable; TrackIdentifier = info.TrackIdentifier; Provider = StreamProviderUtil.GetStreamProvider(info.Source); }
#pragma warning disable CS8618 internal LavalinkTrack(LavalinkTrackInfo info) #pragma warning restore CS8618 { if (info is null) { throw new ArgumentNullException(nameof(info)); } Author = info.Author; Title = info.Title; Source = info.Source; Duration = info.Duration; IsLiveStream = info.IsLiveStream; IsSeekable = info.IsSeekable; TrackIdentifier = info.TrackIdentifier; Provider = info.Source is null ? StreamProvider.Unknown : StreamProviderUtil.GetStreamProvider(info.Source); }