Table of Contents

Class TrackInfo

Namespace
Nyra.Entities
Assembly
Nyra.dll

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

string

Author

The author of the track.

[JsonPropertyName("author")]
[JsonInclude]
public string Author { get; }

Property Value

string

Identifier

The identifier of the track on its source, for example a video id.

[JsonPropertyName("identifier")]
[JsonInclude]
public string Identifier { get; }

Property Value

string

IsSeekable

Whether the track can be sought.

[JsonPropertyName("isSeekable")]
[JsonInclude]
public bool IsSeekable { get; }

Property Value

bool

IsStream

Whether the track is a livestream.

[JsonPropertyName("isStream")]
[JsonInclude]
public bool IsStream { get; }

Property Value

bool

Isrc

The ISRC of the track.

[JsonPropertyName("isrc")]
[JsonInclude]
public string? Isrc { get; }

Property Value

string

Length

The duration of the track, zero for streams.

[JsonIgnore]
public TimeSpan Length { get; }

Property Value

TimeSpan

LengthMilliseconds

Duration in milliseconds.

[JsonPropertyName("length")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long LengthMilliseconds { get; }

Property Value

long

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

TimeSpan

PositionMilliseconds

The saved position of the track, in milliseconds.

[JsonPropertyName("position")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long PositionMilliseconds { get; }

Property Value

long

SourceName

Source that produced the track, for example youtube.

[JsonPropertyName("sourceName")]
[JsonInclude]
public string SourceName { get; }

Property Value

string

Title

The title of the track.

[JsonPropertyName("title")]
[JsonInclude]
public string Title { get; }

Property Value

string

Uri

The URI of the track on its source.

[JsonPropertyName("uri")]
[JsonInclude]
public string? Uri { get; }

Property Value

string

Methods

ToString()

Returns the track as its source, title and author.

public override string ToString()

Returns

string

The track's source, title and author.