Class Chapter
Chapter of a track, from NodeLink's /v4/loadchapters, only YouTube and YouTube Music tracks carry them.
public sealed record Chapter : IEquatable<Chapter>
- Inheritance
-
Chapter
- Implements
- Inherited Members
Properties
Duration
Chapter length, in milliseconds, derived from the next chapter's start.
[JsonPropertyName("duration")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long? Duration { get; }
Property Value
- long?
Remarks
A zero or negative value is the server reporting two boundaries at the same instant (zero) or out of order (negative), not a length. A stream track reports the stream marker here, also not a length.
EndTime
Chapter end, in milliseconds.
[JsonPropertyName("endTime")]
[JsonInclude]
[JsonConverter(typeof(RoundedInt64Converter))]
public long? EndTime { get; }
Property Value
- long?
Remarks
Redundant by construction (the start of the next chapter, or the track's own end for the last one), the server also sends it explicitly, so it is bound for completeness, treat null as unknown.
StartTime
Chapter start, in milliseconds.
[JsonPropertyName("startTime")]
[JsonInclude]
public long StartTime { get; }
Property Value
Remarks
No rounding converter, the server reports whole milliseconds here, a fractional start never reaches the wire.
Thumbnails
The thumbnails of the chapter, raw JSON.
[JsonPropertyName("thumbnails")]
[JsonInclude]
public JsonElement? Thumbnails { get; }
Property Value
Title
The title of the chapter.
[JsonPropertyName("title")]
[JsonInclude]
public string Title { get; }
Property Value
Remarks
Absorbs a null title the server sends, the getter never hands out null, a re-serialized chapter always carries the title as a string.
Methods
Equals(Chapter?)
Indicates whether the chapters carry the same title, times and thumbnails.
public bool Equals(Chapter? other)
Parameters
otherChapterThe chapter to compare with.
Returns
- bool
Whether the members match, the raw thumbnails compared by value.
GetHashCode()
Returns a hash of the chapter's title and times, the raw thumbnails stay out of it.
public override int GetHashCode()
Returns
- int
The hash code.