Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Identifier requires full uri for non-yt links #374

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DisCatSharp.Lavalink/LavalinkGuildPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public async Task<LavalinkGuildPlayer> PlayPartialAsync(string identifier, TimeS
/// <returns>The updated guild player.</returns>
public async Task<LavalinkGuildPlayer> 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;
}

Expand Down Expand Up @@ -343,7 +343,7 @@ public async Task<LavalinkGuildPlayer> PlayAsync(string identifier)
/// <returns>The updated guild player.</returns>
public async Task<LavalinkGuildPlayer> 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;
}

Expand Down Expand Up @@ -452,15 +452,15 @@ public async Task<LavalinkGuildPlayer> PlayDirectUrlAsync(string url)
/// <param name="entry">The entry to add. Please construct a new() entry for every track.</param>
/// <param name="track">The track to attach.</param>
public void AddToQueue<T>(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));

/// <summary>
/// Removes a queue entry.
/// </summary>
/// <param name="entry">The entry to remove.</param>
/// <returns><see langword="true"/> if the entry was found and removed.</returns>
public bool RemoveFromQueue(IQueueEntry entry)
=> this._queueEntriesInternal.Remove(entry.Track.Info.Identifier);
=> this._queueEntriesInternal.Remove(entry.Track.Info.Uri.ToString());

/// <summary>
/// Removes a queue entry by the track identifier.
Expand Down
Loading