Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: dotnet restore src/Lavalink4NET.sln

- name: Build
run: dotnet build src/Lavalink4NET.sln --no-restore --configuration ${{ matrix.configuration }} /property:Version=4.1.0
run: dotnet build src/Lavalink4NET.sln --no-restore --configuration ${{ matrix.configuration }} /property:Version=4.1.1

- name: Run tests
working-directory: ci
Expand Down
5 changes: 4 additions & 1 deletion src/Lavalink4NET.Protocol/Requests/VoiceStateProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public sealed record class VoiceStateProperties(

[property: JsonRequired]
[property: JsonPropertyName("sessionId")]
string SessionId);
string SessionId,

[property: JsonPropertyName("channelId")]
string? ChannelId);
9 changes: 5 additions & 4 deletions src/Lavalink4NET/Players/LavalinkPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ private void Refresh(PlayerInformationModel model)

// TODO: restore filters
}

protected virtual ITrackQueueItem? LookupTrackQueueItem(LavalinkTrack receivedTrack, ITrackQueueItem? currentItem,
string? overridenTrackIdentifier)
{
Expand Down Expand Up @@ -708,7 +708,8 @@ private ValueTask UpdateVoiceCredentialsAsync(CancellationToken cancellationToke
VoiceState = new VoiceStateProperties(
Token: VoiceServer.Value.Token,
Endpoint: VoiceServer.Value.Endpoint,
SessionId: VoiceState.SessionId),
SessionId: VoiceState.SessionId,
ChannelId: VoiceState.VoiceChannelId?.ToString()),
};

var voiceServerName = GetVoiceServerName(VoiceServer.Value);
Expand Down Expand Up @@ -749,8 +750,8 @@ private ValueTask UpdateVoiceCredentialsAsync(CancellationToken cancellationToke
return CurrentItem;
}

return LookupTrackQueueItem(track, CurrentItem, null)

return LookupTrackQueueItem(track, CurrentItem, null)
?? new TrackQueueItem(new TrackReference(track));
}

Expand Down
9 changes: 5 additions & 4 deletions src/Lavalink4NET/Players/LavalinkPlayerHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ private async ValueTask CompleteAsync(bool isVoiceServerUpdated, CancellationTok
// CreatePlayerAsync can throw if request to lavalink fails
// We should handle this to avoid never completed lavalink player handle
var player = await CreatePlayerAsync(cancellationToken).ConfigureAwait(false);

taskCompletionSource.TrySetResult(player);

Interlocked.Decrement(ref Diagnostics.PendingHandles);
Interlocked.Increment(ref Diagnostics.ActivePlayers);
}
Expand Down Expand Up @@ -199,7 +199,8 @@ private async ValueTask<TPlayer> CreatePlayerAsync(CancellationToken cancellatio
VoiceState = new VoiceStateProperties(
Token: _voiceServer.Value.Token,
Endpoint: _voiceServer.Value.Endpoint,
SessionId: _voiceState.Value.SessionId!),
SessionId: _voiceState.Value.SessionId!,
ChannelId: _voiceState.Value.VoiceChannelId?.ToString()),
};

if (_options.Value.InitialTrack is not null)
Expand All @@ -210,7 +211,7 @@ private async ValueTask<TPlayer> CreatePlayerAsync(CancellationToken cancellatio
if (initialTrack.Reference.IsPresent)
{
var playableTrack = await initialTrack.Reference.Track.GetPlayableTrackAsync(cancellationToken);
playerProperties = playerProperties with { TrackData = playableTrack.ToString()};
playerProperties = playerProperties with { TrackData = playableTrack.ToString() };
}
else
{
Expand Down
Loading