Class TrackInfo
The descriptive info of a track.
public sealed record TrackInfo : IEquatable<TrackInfo>
- Inheritance
-
TrackInfo
- Implements
- Inherited Members
Remarks
A null the server sends for the identifier, author, title or source name reads as an empty string.
Properties
ArtworkUrl
The artwork of the track.
[JsonPropertyName("artworkUrl")]
[JsonInclude]
public string? ArtworkUrl { get; }
Property Value
Author
The author of the track.
[JsonPropertyName("author")]
[JsonInclude]
public string Author { get; }
Property Value
Identifier
The identifier of the track on its source, for example a video id.
[JsonPropertyName("identifier")]
[JsonInclude]
public string Identifier { get; }
Property Value
IsSeekable
Whether the track can be sought.
[JsonPropertyName("isSeekable")]
[JsonInclude]
public bool IsSeekable { get; }
Property Value
IsStream
Whether the track is a livestream.
[JsonPropertyName("isStream")]
[JsonInclude]
public bool IsStream { get; }
Property Value
Isrc
The ISRC of the track.
[JsonPropertyName("isrc")]
[JsonInclude]
public string? Isrc { get; }
Property Value
Length
The duration of the track, zero for streams.
[JsonIgnore]
public TimeSpan Length { get; }
Property Value
LengthMilliseconds
Duration in milliseconds.
[JsonPropertyName("length")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long LengthMilliseconds { get; }
Property Value
Remarks
For streams, Lavalink sends MaxValue and NodeLink 0 (or -1 for YouTube lives and the HTTP source's streams), Length returns zero for all. A stream marker echoed back as a floating-point number is clamped to the marker instead of failing the parse.
Position
The saved position of the track.
[JsonIgnore]
public TimeSpan Position { get; }
Property Value
PositionMilliseconds
The saved position of the track, in milliseconds.
[JsonPropertyName("position")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long PositionMilliseconds { get; }
Property Value
SourceName
Source that produced the track, for example youtube.
[JsonPropertyName("sourceName")]
[JsonInclude]
public string SourceName { get; }
Property Value
Title
The title of the track.
[JsonPropertyName("title")]
[JsonInclude]
public string Title { get; }
Property Value
Uri
The URI of the track on its source.
[JsonPropertyName("uri")]
[JsonInclude]
public string? Uri { get; }
Property Value
Methods
ToString()
Returns the track as its source, title and author.
public override string ToString()
Returns
- string
The track's source, title and author.