From b81946495d0ccab03937c30637aa403935c5b76f Mon Sep 17 00:00:00 2001 From: Mira <56395159+TheXorog@users.noreply.github.com> Date: Fri, 13 Oct 2023 00:38:14 +0200 Subject: [PATCH] fix: Identifier requires full uri for non-yt links --- DisCatSharp.Lavalink/LavalinkGuildPlayer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DisCatSharp.Lavalink/LavalinkGuildPlayer.cs b/DisCatSharp.Lavalink/LavalinkGuildPlayer.cs index 8ac326bec..257d630a6 100644 --- a/DisCatSharp.Lavalink/LavalinkGuildPlayer.cs +++ b/DisCatSharp.Lavalink/LavalinkGuildPlayer.cs @@ -308,7 +308,7 @@ public async Task PlayPartialAsync(string identifier, TimeS /// The updated guild player. public async Task PlayPartialAsync(LavalinkTrack track, TimeSpan startTime, TimeSpan endTime) { - this.Player = await this.Session.Rest.UpdatePlayerAsync(this.Session.Config.SessionId!, this.GuildId, false, identifier: track.Info.Identifier, position: (int)startTime.TotalMilliseconds, endTime: (int)endTime.TotalMilliseconds).ConfigureAwait(false); + this.Player = await this.Session.Rest.UpdatePlayerAsync(this.Session.Config.SessionId!, this.GuildId, false, identifier: track.Info.Uri.ToString(), position: (int)startTime.TotalMilliseconds, endTime: (int)endTime.TotalMilliseconds).ConfigureAwait(false); return this; } @@ -343,7 +343,7 @@ public async Task PlayAsync(string identifier) /// The updated guild player. public async Task PlayAsync(LavalinkTrack track) { - this.Player = await this.Session.Rest.UpdatePlayerAsync(this.Session.Config.SessionId!, this.GuildId, false, identifier: track.Info.Identifier).ConfigureAwait(false); + this.Player = await this.Session.Rest.UpdatePlayerAsync(this.Session.Config.SessionId!, this.GuildId, false, identifier: track.Info.Uri.ToString()).ConfigureAwait(false); return this; } @@ -452,7 +452,7 @@ public async Task PlayDirectUrlAsync(string url) /// The entry to add. Please construct a new() entry for every track. /// The track to attach. public void AddToQueue(T entry, LavalinkTrack track) where T : IQueueEntry - => this._queueEntriesInternal.Add(track.Info.Identifier, entry.AddTrack(track)); + => this._queueEntriesInternal.Add(track.Info.Uri.ToString(), entry.AddTrack(track)); /// /// Removes a queue entry. @@ -460,7 +460,7 @@ public void AddToQueue(T entry, LavalinkTrack track) where T : IQueueEntry /// The entry to remove. /// if the entry was found and removed. public bool RemoveFromQueue(IQueueEntry entry) - => this._queueEntriesInternal.Remove(entry.Track.Info.Identifier); + => this._queueEntriesInternal.Remove(entry.Track.Info.Uri.ToString()); /// /// Removes a queue entry by the track identifier.