From 9a7a1dffb29bd026f775ae64370d117a43676cd6 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Mon, 12 Oct 2026 19:39:49 +0300 Subject: [PATCH] Adds example values to the API endpoint documentation summaries. --- .../AddAlbum/AddAlbumEndpointSummary.cs | 6 +- .../GetAlbum/GetAlbumEndpointSummary.cs | 199 +++++++++++++++++- .../GetAlbumTracksLiteEndpointSummary.cs | 7 +- .../UpdateAlbum/UpdateAlbumEndpointSummary.cs | 192 ++++++++++++++++- .../AddArtist/AddArtistEndpointSummary.cs | 6 +- .../GetArtist/GetArtistEndpointSummary.cs | 8 +- .../GetArtistAlbumsEndpointSummary.cs | 191 ++++++++++++++++- .../GetArtistAlbumsLiteEndpointSummary.cs | 11 +- .../GetArtists/GetArtistsEndpointSummary.cs | 15 +- .../GetArtistsLiteEndpointSummary.cs | 20 +- .../UpdateArtistEndpointSummary.cs | 6 +- .../Books/AddBook/AddBookEndpointSummary.cs | 2 +- .../Books/GetBooks/GetBooksEndpointSummary.cs | 4 +- .../GetBooksLiteEndpointSummary.cs | 4 +- 14 files changed, 642 insertions(+), 29 deletions(-) diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs index 26fc8125..0ad7ef8f 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/AddAlbum/AddAlbumEndpointSummary.cs @@ -11,6 +11,7 @@ using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks; using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -636,8 +637,9 @@ public class AddAlbumEndpointSummary : Summary ResponseParam(r => r.Metadata!.Genres, "The list of genres associated with the album."); ResponseParam(r => r.Metadata!.Tags, "The list of tags that further describe or categorize the album."); ResponseParam(r => r.Tracks, "The list of tracks of the album."); + ResponseParam(r => r.CoverPath, "The path of the image representing the album, if available."); + ResponseParam(r => r.Artwork, "The stored artwork of the album, in display order, if applicable."); Response(200, "The requested album is returned.", example: new AlbumResponse( @@ -142,8 +145,200 @@ public class GetAlbumEndpointSummary : Summary ], CreatedOnUtc: new DateTime(2025, 1, 15, 10, 30, 0, DateTimeKind.Utc), UpdatedOnUtc: new DateTime(2025, 1, 20, 14, 45, 0, DateTimeKind.Utc), - Tracks: [] - ) + Tracks: + [ + new( + Id: Guid.NewGuid(), + AlbumId: Guid.NewGuid(), + LibraryId: Guid.NewGuid(), + Path: "/music/queen/a-night-at-the-opera/01-bohemian-rhapsody.flac", + Metadata: new( + Title: "Bohemian Rhapsody", + OriginalTitle: "Bohemian Rhapsody", + Description: "A song by the British rock band Queen. It was written by Freddie Mercury and originally released on the album A Night at the Opera in 1975.", + Disambiguation: "album version", + ReleaseInfo: new( + OriginalReleaseDate: new DateOnly(1975, 10, 31), + OriginalReleaseYear: 1975, + ReReleaseDate: new DateOnly(2011, 11, 21), + ReReleaseYear: 2011, + ReleaseCountry: ReleaseCountry.GB, + ReleaseVersion: "Original" + ), + Language: new( + LanguageCode: "en", + LanguageName: "English", + NativeName: "English" + ), + OriginalLanguage: new( + LanguageCode: "en", + LanguageName: "English", + NativeName: "English" + ), + Tags: [ + new(Name: "classic"), + new(Name: "epic") + ], + Genres: [ + new(Name: "Rock"), + new(Name: "Progressive Rock") + ], + DurationInSeconds: 354, + SampleRate: 44100, + Channels: 2, + BitDepth: 16, + AudioCodec: "FLAC", + Bitrate: 980, + IsVideo: false + ), + Script: "Latn", + Key: MusicKey.CMajor, + Bpm: 72, + Work: new MusicWorkDto( + MusicBrainzWorkId: Guid.NewGuid(), + Title: "Bohemian Rhapsody", + Type: "Song", + Languages: [new LanguageInfoDto(LanguageCode: "en", LanguageName: "English", NativeName: "English")], + Iswcs: ["T-010489707-6"] + ), + Isrcs: [ + new(Value: "GBUM71029604") + ], + Moods: [ + new(Name: "dramatic"), + new(Name: "anxious") + ], + MusicBrainzRecordingId: Guid.NewGuid(), + MusicBrainzTrackId: Guid.NewGuid(), + Contributors: [ + new MediaContributorReferenceDto( + ContributorId: Guid.NewGuid(), + Role: MediaContributorRole.Vocals + ), + new MediaContributorReferenceDto( + ContributorId: Guid.NewGuid(), + Role: MediaContributorRole.Guitar + ) + ], + Ratings: [ + new( + Value: 4.5M, + MaxValue: 5, + Source: AudioRatingSource.MusicBrainz, + VoteCount: 2345 + ), + new( + Value: 4.8M, + MaxValue: 5, + Source: AudioRatingSource.LastFm, + VoteCount: 1234 + ) + ], + TrackNumber: 1, + DiscNumber: 1, + CreatedOnUtc: new DateTime(2025, 1, 15, 10, 30, 0, DateTimeKind.Utc), + UpdatedOnUtc: new DateTime(2025, 1, 20, 14, 45, 0, DateTimeKind.Utc) + ), + new( + Id: Guid.NewGuid(), + AlbumId: Guid.NewGuid(), + LibraryId: Guid.NewGuid(), + Path: "/music/queen/a-night-at-the-opera/07-youre-my-best-friend.flac", + Metadata: new( + Title: "You're My Best Friend", + OriginalTitle: "You're My Best Friend", + Description: "A song by the British rock band Queen, written by bass guitarist John Deacon. It was originally released on the album A Night at the Opera in 1975 and as a single in 1976.", + Disambiguation: "album version", + ReleaseInfo: new( + OriginalReleaseDate: new DateOnly(1976, 6, 18), + OriginalReleaseYear: 1976, + ReReleaseDate: new DateOnly(2011, 11, 21), + ReReleaseYear: 2011, + ReleaseCountry: ReleaseCountry.GB, + ReleaseVersion: "Original" + ), + Language: new( + LanguageCode: "en", + LanguageName: "English", + NativeName: "English" + ), + OriginalLanguage: new( + LanguageCode: "en", + LanguageName: "English", + NativeName: "English" + ), + Tags: [ + new(Name: "classic"), + new(Name: "love") + ], + Genres: [ + new(Name: "Rock"), + new(Name: "Pop Rock") + ], + DurationInSeconds: 181, + SampleRate: 44100, + Channels: 2, + BitDepth: 16, + AudioCodec: "FLAC", + Bitrate: 912, + IsVideo: false + ), + Script: "Latn", + Key: MusicKey.BMajor, + Bpm: 118, + Work: new MusicWorkDto( + MusicBrainzWorkId: Guid.NewGuid(), + Title: "You're My Best Friend", + Type: "Song", + Languages: [new LanguageInfoDto(LanguageCode: "en", LanguageName: "English", NativeName: "English")], + Iswcs: ["T-010489707-6"] + ), + Isrcs: [ + new(Value: "GBUM71029609") + ], + Moods: [ + new(Name: "happy"), + new(Name: "warm") + ], + MusicBrainzRecordingId: Guid.NewGuid(), + MusicBrainzTrackId: Guid.NewGuid(), + Contributors: [ + new MediaContributorReferenceDto( + ContributorId: Guid.NewGuid(), + Role: MediaContributorRole.Vocals + ), + new MediaContributorReferenceDto( + ContributorId: Guid.NewGuid(), + Role: MediaContributorRole.Guitar + ) + ], + Ratings: [ + new( + Value: 4.2M, + MaxValue: 5, + Source: AudioRatingSource.MusicBrainz, + VoteCount: 1234 + ), + new( + Value: 4.4M, + MaxValue: 5, + Source: AudioRatingSource.LastFm, + VoteCount: 567 + ) + ], + TrackNumber: 7, + DiscNumber: 1, + CreatedOnUtc: new DateTime(2025, 1, 15, 10, 30, 0, DateTimeKind.Utc), + UpdatedOnUtc: new DateTime(2025, 1, 20, 14, 45, 0, DateTimeKind.Utc) + ) + ], + CoverPath: "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/cover.jpg", + Artwork: + [ + new MediaArtworkDto(ArtworkType.Cover, 0, "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/cover.jpg"), + new MediaArtworkDto(ArtworkType.Back, 0, "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/back.jpg"), + new MediaArtworkDto(ArtworkType.Booklet, 0, "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/booklet.jpg") + ]) ); Response(401, "Authentication required.", "application/problem+json", diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLite/GetAlbumTracksLiteEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLite/GetAlbumTracksLiteEndpointSummary.cs index 9d152542..ba444db1 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLite/GetAlbumTracksLiteEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLite/GetAlbumTracksLiteEndpointSummary.cs @@ -36,6 +36,7 @@ public class GetAlbumTracksLiteEndpointSummary : Summary(r => r.Title, "The title of the track."); ResponseParam(r => r.TrackNumber, "The number of the track on its disc."); ResponseParam(r => r.DiscNumber, "The number of the disc the track belongs to, if applicable."); + ResponseParam(r => r.DurationInSeconds, "The duration of the track in seconds."); Response(200, "The paginated list of the lightweight read models of the tracks of the album is returned.", example: new PaginatedResponse @@ -46,13 +47,15 @@ public class GetAlbumTracksLiteEndpointSummary : Summary CreatedOnUtc: new DateTime(2025, 1, 15, 10, 30, 0, DateTimeKind.Utc), UpdatedOnUtc: new DateTime(2025, 1, 20, 14, 45, 0, DateTimeKind.Utc) ) - ] + ], + CoverPath: "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/cover.jpg", + Artwork: [new MediaArtworkDto(ArtworkType.Cover, 0, "/media/music/Queen-3b3a19f3/A Night at the Opera-e8d52f7b/cover.jpg")] ) - ] + ], + CoverPath: "/media/music/Queen-3b3a19f3/cover.jpg" ) ); diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs index a70cc6d0..274c3421 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/AudioLibrary/MusicLibrary/Artists/GetArtistAlbums/GetArtistAlbumsEndpointSummary.cs @@ -8,6 +8,7 @@ using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Albums; using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary; using Lumina.Domain.SharedKernel.Common.Enums.Common; using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors; +using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -144,7 +145,103 @@ public class GetArtistAlbumsEndpointSummary : Summary r.CurrentPage, "The page of results to retrieve. Optional."); RequestParam(r => r.PerPage, "The maximum number of artists to retrieve per page. Optional."); RequestParam(r => r.SearchTerm, "The search term used to filter the artists by name. Optional."); + RequestParam(r => r.FilterAlphaKey, "The alpha key used to filter the artists by the first character of their name, for the alpha picker. Optional."); + RequestParam(r => r.ShouldIgnoreThePrefixForAlphaPicker, "Whether the leading \"The \" prefix of a name is ignored when computing the alpha key, or not."); + RequestParam(r => r.SortBy, "The name of the field by which to sort the results. Optional."); + RequestParam(r => r.SortOrder, "The direction in which to sort the results. Optional."); ResponseParam(r => r.Id, "The Id of the artist."); ResponseParam(r => r.Name, "The name of the artist."); @@ -44,11 +53,13 @@ public class GetArtistsLiteEndpointSummary : Summary MetadataProvider: default, CreatedOnUtc: DateTime.UtcNow, UpdatedOnUtc: default, - CoverPath: null + CoverPath: "/media/books/tolkien/the-fellowship-of-the-ring/cover.jpg" ) ); diff --git a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs index 7db1af98..7fa8eba3 100644 --- a/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs +++ b/src/Lumina.Presentation.Api/Core/Endpoints/Library/WrittenContentLibrary/BookLibrary/Books/GetBooks/GetBooksEndpointSummary.cs @@ -147,7 +147,7 @@ public class GetBooksEndpointSummary : Summary