Skip to content

Commit

Permalink
Fix tests*
Browse files Browse the repository at this point in the history
  • Loading branch information
NycroV committed Oct 13, 2024
1 parent b3e4120 commit 2f6d97c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ public partial record class LavalinkTrack : ISpanFormattable

public override string ToString() => ToString(version: null);

public string ToString(int? version) => Utf8ToUtf16(Serialize(version));
public string ToString(int? version)
{
if (TrackData is null || version is not null)
TrackData = Utf8ToUtf16(Serialize(version));

return TrackData;
}

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public byte[] Serialize(int? version = null)
? long.MaxValue
: (long)Math.Round(Duration.TotalMilliseconds);

writer.Write(version.Value);
writer.Write((byte)version.Value);
writer.Write(Title);
writer.Write(Author);
writer.Write(duration);
Expand Down

0 comments on commit 2f6d97c

Please sign in to comment.