mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
Adds the music track stream endpoint
Adds the track stream route, its query, validator and handler, a flat stream projection in the track repository, and an endpoint that streams the audio file with HTTP range support. Excludes the route from the eventual consistency pipeline through endpoint metadata and limits it per user with a concurrency limiter. Missing, unreadable and out of scope files are reported as not found without leaking the path. Adds the API and request documentation and the stream tests.
This commit is contained in:
1 parent
0ad6e1307b
commit
4ffa81fffe
18 files changed
+985
No files matched your search
+16
@@ -58,6 +58,22 @@ public interface ITrackRepository : IRepository<TrackEntity>,
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the <see cref="TrackEntity"/> stored at the provided path, or an error.</returns>
|
||||
Task<Result<TrackEntity?>> GetByPathAsync(Guid libraryId, string path, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data needed to stream the audio file of the track identified by <paramref name="trackId"/>, when it belongs to the album identified by
|
||||
/// <paramref name="albumId"/> and to the media library identified by <paramref name="libraryId"/>, and that album belongs to the artist identified by
|
||||
/// <paramref name="artistId"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library the track must belong to.</param>
|
||||
/// <param name="albumId">The Id of the album the track must belong to.</param>
|
||||
/// <param name="artistId">The Id of the artist that must own the album the track belongs to.</param>
|
||||
/// <param name="trackId">The Id of the track whose streaming data is retrieved.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="Result{TValue}"/> containing either the <see cref="TrackStreamDto"/> of the track, <see langword="null"/> when no track matches the
|
||||
/// provided identifiers, or an error.
|
||||
/// </returns>
|
||||
Task<Result<TrackStreamDto?>> GetTrackStreamInfoAsync(Guid libraryId, Guid albumId, Guid artistId, Guid trackId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the enrichment state of the tracks stored at the provided <paramref name="paths"/> in the media library identified by
|
||||
/// <paramref name="libraryId"/>, together with their albums and artists, so that they are re-enriched, because their content changed since the last scan.
|
||||
|
||||
Reference in new issue
Block a user