Removes redundant qualifiers and a cast from the track stream endpoint

Drops the redundant FastEndpoints namespace qualification of EmptyRequest and the redundant cast of the audio byte array length in the stream endpoint and its tests.
This commit is contained in:
BinaryAlley committed 2026-10-14 13:40:44 +03:00
1 parent f29f89f31f
commit f97c5bed47
2 files changed
+3 -3

No files matched your search

@@ -21,7 +21,7 @@ namespace Lumina.Presentation.Api.Core.Endpoints.Library.AudioLibrary.MusicLibra
/// <summary>
/// API endpoint for the <c>/libraries/{libraryId}/artists/{artistId}/albums/{albumId}/tracks/{trackId}/stream</c> route.
/// </summary>
public class GetTrackStreamEndpoint : BaseEndpoint<FastEndpoints.EmptyRequest, IResult>
public class GetTrackStreamEndpoint : BaseEndpoint<EmptyRequest, IResult>
{
private readonly IQueryHandler<GetTrackStreamQuery, Result<TrackStreamDataDto>> _getTrackStreamQueryHandler;
@@ -55,7 +55,7 @@ public class GetTrackStreamEndpoint : BaseEndpoint<FastEndpoints.EmptyRequest, I
/// </summary>
/// <param name="request">The request object.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
public override async Task<IResult> ExecuteAsync(FastEndpoints.EmptyRequest request, CancellationToken cancellationToken)
public override async Task<IResult> ExecuteAsync(EmptyRequest request, CancellationToken cancellationToken)
{
// Take unique identifiers from the route.
string? libraryId = HttpContext.Request.RouteValues["libraryId"]?.ToString();
@@ -80,7 +80,7 @@ public class GetTrackStreamEndpointTests : IClassFixture<AuthenticatedLuminaApiF
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal("audio/mpeg", response.Content.Headers.ContentType?.MediaType);
Assert.Equal((long)audioBytes.Length, response.Content.Headers.ContentLength!.Value);
Assert.Equal(audioBytes.Length, response.Content.Headers.ContentLength!.Value);
Assert.Contains("bytes", response.Headers.AcceptRanges);
Assert.NotNull(response.Headers.ETag);
Assert.NotNull(response.Content.Headers.LastModified);