Refactors the book, artist, and album slices across the stack

This commit is contained in:
BinaryAlley committed 2026-09-17 13:30:48 -07:00
1 parent 8aaf9fe64e
commit ea6eb9f796
439 files changed
+28235 -3156

No files matched your search

@@ -0,0 +1,40 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to add an album to an artist, together with the tracks of the album.
/// </summary>
/// <param name="Metadata">The album metadata of the album. Required.</param>
/// <param name="MediaFormat">The physical or digital medium of the album. Optional.</param>
/// <param name="Barcode">The barcode of the album. Optional.</param>
/// <param name="CatalogNumber">The catalog number of the album. Optional.</param>
/// <param name="MusicBrainzReleaseId">The MusicBrainz identifier of the release. Optional.</param>
/// <param name="MusicBrainzReleaseGroupId">The MusicBrainz identifier of the release group. Optional.</param>
/// <param name="MusicBrainzReleaseArtistId">The MusicBrainz identifier of the release artist. Optional.</param>
/// <param name="Contributors">The list of media contributors that performed on the album. Required.</param>
/// <param name="Ratings">The list of ratings for this album. Required.</param>
/// <param name="Tracks">The list of tracks of the album. Required.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record AddAlbumRequest(
AlbumMetadataDto? Metadata,
MusicMediaFormat? MediaFormat,
string? Barcode,
string? CatalogNumber,
Guid? MusicBrainzReleaseId,
Guid? MusicBrainzReleaseGroupId,
Guid? MusicBrainzReleaseArtistId,
List<MediaContributorReferenceDto>? Contributors,
List<AudioRatingDto>? Ratings,
List<AddTrackRequest>? Tracks
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to delete an album by the specified Id.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album to delete.</param>
[DebuggerDisplay("AlbumId: {AlbumId}")]
public record DeleteAlbumRequest(
Guid ArtistId,
Guid AlbumId
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to get an album by the specified Id.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album to retrieve.</param>
[DebuggerDisplay("AlbumId: {AlbumId}")]
public record GetAlbumRequest(
Guid ArtistId,
Guid AlbumId
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to get the lightweight read models of the tracks of an album.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album whose tracks are retrieved.</param>
/// <param name="CurrentPage">The page of results to retrieve. Optional.</param>
/// <param name="PerPage">The maximum number of tracks to retrieve per page. Optional.</param>
[DebuggerDisplay("AlbumId: {AlbumId}")]
public record GetAlbumTracksLiteRequest(
Guid ArtistId,
Guid AlbumId,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to get the tracks of an album.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album whose tracks are retrieved.</param>
[DebuggerDisplay("AlbumId: {AlbumId}")]
public record GetAlbumTracksRequest(
Guid ArtistId,
Guid AlbumId
);
@@ -0,0 +1,37 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
/// <summary>
/// Represents a request to update an existing album.
/// </summary>
/// <param name="Metadata">The album metadata of the album. Required.</param>
/// <param name="MediaFormat">The physical or digital medium of the album. Optional.</param>
/// <param name="Barcode">The barcode of the album. Optional.</param>
/// <param name="CatalogNumber">The catalog number of the album. Optional.</param>
/// <param name="MusicBrainzReleaseId">The MusicBrainz identifier of the release. Optional.</param>
/// <param name="MusicBrainzReleaseGroupId">The MusicBrainz identifier of the release group. Optional.</param>
/// <param name="MusicBrainzReleaseArtistId">The MusicBrainz identifier of the release artist. Optional.</param>
/// <param name="Contributors">The list of media contributors that performed on the album. Optional.</param>
/// <param name="Ratings">The list of ratings for this album. Required.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record UpdateAlbumRequest(
AlbumMetadataDto? Metadata,
MusicMediaFormat? MediaFormat,
string? Barcode,
string? CatalogNumber,
Guid? MusicBrainzReleaseId,
Guid? MusicBrainzReleaseGroupId,
Guid? MusicBrainzReleaseArtistId,
List<MediaContributorReferenceDto>? Contributors,
List<AudioRatingDto>? Ratings
);
@@ -0,0 +1,26 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to add an artist, together with the albums of the artist and the tracks of those albums.
/// </summary>
/// <param name="Name">The name of the artist. Required.</param>
/// <param name="Website">The website of the artist. Optional.</param>
/// <param name="MusicBrainzArtistId">The MusicBrainz identifier of the artist. Optional.</param>
/// <param name="Contributors">The list of media contributors that make up the artist. Required.</param>
/// <param name="Albums">The list of albums of the artist, each with its own list of tracks. Required.</param>
[DebuggerDisplay("Name: {Name}")]
public record AddArtistRequest(
string? Name,
string? Website,
Guid? MusicBrainzArtistId,
List<MediaContributorReferenceDto>? Contributors,
List<AddAlbumRequest>? Albums
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to get the lightweight read models of the albums of an artist.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist whose albums are retrieved.</param>
/// <param name="CurrentPage">The page of results to retrieve. Optional.</param>
/// <param name="PerPage">The maximum number of albums to retrieve per page. Optional.</param>
[DebuggerDisplay("ArtistId: {ArtistId}")]
public record GetArtistAlbumsLiteRequest(
Guid ArtistId,
int? CurrentPage,
int? PerPage
);
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to get the albums of an artist.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist whose albums are retrieved.</param>
[DebuggerDisplay("ArtistId: {ArtistId}")]
public record GetArtistAlbumsRequest(
Guid ArtistId
);
@@ -0,0 +1,15 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to get an artist by the specified Id.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist to retrieve.</param>
[DebuggerDisplay("ArtistId: {ArtistId}")]
public record GetArtistRequest(
Guid ArtistId
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to get the lightweight read models of the artists of a media library.
/// </summary>
/// <param name="LibraryId">The Id of the media library whose artists are retrieved. Required.</param>
/// <param name="CurrentPage">The page of results to retrieve. Optional.</param>
/// <param name="PerPage">The maximum number of artists to retrieve per page. Optional.</param>
/// <param name="SearchTerm">The search term used to filter the artists by name. Optional.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetArtistsLiteRequest(
Guid LibraryId,
int? CurrentPage,
int? PerPage,
string? SearchTerm
);
@@ -0,0 +1,21 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to get the artists of a media library.
/// </summary>
/// <param name="LibraryId">The Id of the media library whose artists are retrieved. Required.</param>
/// <param name="CurrentPage">The page of results to retrieve. Optional.</param>
/// <param name="PerPage">The maximum number of artists to retrieve per page. Optional.</param>
/// <param name="SearchTerm">The search term used to filter the artists by name. Optional.</param>
[DebuggerDisplay("LibraryId: {LibraryId}")]
public record GetArtistsRequest(
Guid LibraryId,
int? CurrentPage,
int? PerPage,
string? SearchTerm
);
@@ -0,0 +1,26 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
/// <summary>
/// Represents a request to update an existing artist.
/// </summary>
/// <param name="Name">The name of the artist. Required.</param>
/// <param name="Website">The website of the artist. Optional.</param>
/// <param name="MusicBrainzArtistId">The MusicBrainz identifier of the artist. Optional.</param>
/// <param name="Contributors">The list of media contributors that make up the artist. Required.</param>
/// <param name="Albums">The list of albums of the artist, each with its own list of tracks. Required.</param>
[DebuggerDisplay("Name: {Name}")]
public record UpdateArtistRequest(
string? Name,
string? Website,
Guid? MusicBrainzArtistId,
List<MediaContributorReferenceDto>? Contributors,
List<AddAlbumRequest>? Albums
);
@@ -0,0 +1,49 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to add a track to an album.
/// </summary>
/// <param name="Path">The file system path of the track. Required.</param>
/// <param name="Metadata">The audio metadata of the track. Required.</param>
/// <param name="TrackNumber">The number of the track on its disc. Required.</param>
/// <param name="DiscNumber">The number of the disc the track belongs to. Optional.</param>
/// <param name="Script">The script used by the language of the track. Optional.</param>
/// <param name="Key">The musical key of the track. Optional.</param>
/// <param name="Bpm">The tempo of the track in beats per minute. Optional.</param>
/// <param name="Work">The title of the work the track is a recording of. Optional.</param>
/// <param name="MusicBrainzRecordingId">The MusicBrainz identifier of the recording. Optional.</param>
/// <param name="MusicBrainzTrackId">The MusicBrainz identifier of the track. Optional.</param>
/// <param name="MusicBrainzWorkId">The MusicBrainz identifier of the work. Optional.</param>
/// <param name="Moods">The list of moods of the track. Optional.</param>
/// <param name="Isrcs">The list of ISRC (International Standard Recording Code) of the track. Optional.</param>
/// <param name="Contributors">The list of media contributors that performed on the track. Required.</param>
/// <param name="Ratings">The list of ratings for this track. Required.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record AddTrackRequest(
string? Path,
AudioMetadataDto? Metadata,
int? TrackNumber,
int? DiscNumber,
string? Script,
MusicKey? Key,
int? Bpm,
string? Work,
Guid? MusicBrainzRecordingId,
Guid? MusicBrainzTrackId,
Guid? MusicBrainzWorkId,
List<MoodDto>? Moods,
List<IsrcDto>? Isrcs,
List<MediaContributorReferenceDto>? Contributors,
List<AudioRatingDto>? Ratings
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to delete a track by the specified Id.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album of the track belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album the track belongs to, taken from the route.</param>
/// <param name="TrackId">The unique identifier of the track to delete.</param>
[DebuggerDisplay("TrackId: {TrackId}")]
public record DeleteTrackRequest(
Guid ArtistId,
Guid AlbumId,
Guid TrackId
);
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to get a track by the specified Id.
/// </summary>
/// <param name="ArtistId">The unique identifier of the artist the album of the track belongs to, taken from the route.</param>
/// <param name="AlbumId">The unique identifier of the album the track belongs to, taken from the route.</param>
/// <param name="TrackId">The unique identifier of the track to retrieve.</param>
[DebuggerDisplay("TrackId: {TrackId}")]
public record GetTrackRequest(
Guid ArtistId,
Guid AlbumId,
Guid TrackId
);
@@ -0,0 +1,49 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Contracts.DTO.Common;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
/// <summary>
/// Represents a request to update an existing track.
/// </summary>
/// <param name="Path">The file system path of the track. Required.</param>
/// <param name="Metadata">The audio metadata of the track. Required.</param>
/// <param name="TrackNumber">The number of the track on its disc. Required.</param>
/// <param name="DiscNumber">The number of the disc the track belongs to. Optional.</param>
/// <param name="Script">The script used by the language of the track. Optional.</param>
/// <param name="Key">The musical key of the track. Optional.</param>
/// <param name="Bpm">The tempo of the track in beats per minute. Optional.</param>
/// <param name="Work">The title of the work the track is a recording of. Optional.</param>
/// <param name="MusicBrainzRecordingId">The MusicBrainz identifier of the recording. Optional.</param>
/// <param name="MusicBrainzTrackId">The MusicBrainz identifier of the track. Optional.</param>
/// <param name="MusicBrainzWorkId">The MusicBrainz identifier of the work. Optional.</param>
/// <param name="Contributors">The list of media contributors that performed on the track. Optional.</param>
/// <param name="Ratings">The list of ratings for this track. Required.</param>
/// <param name="Moods">The list of moods of the track. Optional.</param>
/// <param name="Isrcs">The list of ISRC (International Standard Recording Code) of the track. Optional.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record UpdateTrackRequest(
string? Path,
AudioMetadataDto? Metadata,
int? TrackNumber,
int? DiscNumber,
string? Script,
MusicKey? Key,
int? Bpm,
string? Work,
Guid? MusicBrainzRecordingId,
Guid? MusicBrainzTrackId,
Guid? MusicBrainzWorkId,
List<MediaContributorReferenceDto>? Contributors,
List<AudioRatingDto>? Ratings,
List<MoodDto>? Moods,
List<IsrcDto>? Isrcs
);
@@ -33,7 +33,7 @@ namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibra
/// <param name="Ratings">The list of ratings for this book. Required.</param>
[DebuggerDisplay("Title: {Metadata.Title}")]
public record AddBookRequest(
string Path,
string? Path,
WrittenContentMetadataDto? Metadata,
BookFormat? Format,
string? Edition,
@@ -1,15 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to check the reading availability of a book.
/// </summary>
/// <param name="BookId">The Id of the book whose reading availability is checked. Required.</param>
[DebuggerDisplay("BookId: {BookId}")]
public sealed record GetReadingAvailabilityRequest(
Guid BookId
);
@@ -1,15 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get the reading manifest of a book.
/// </summary>
/// <param name="BookId">The Id of the book whose reading manifest is retrieved. Required.</param>
[DebuggerDisplay("BookId: {BookId}")]
public sealed record GetReadingManifestRequest(
Guid BookId
);
@@ -1,17 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get a resource of a book, for reading.
/// </summary>
/// <param name="BookId">The Id of the book whose resource is retrieved. Required.</param>
/// <param name="ResourceKey">The opaque resource key of the resource. Required.</param>
[DebuggerDisplay("BookId: {BookId}, ResourceKey: {ResourceKey}")]
public sealed record GetReadingResourceRequest(
Guid BookId,
string ResourceKey
);
@@ -1,17 +0,0 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.WrittenContentLibrary.BookLibrary.Books.Reading;
/// <summary>
/// Represents a request to get the content of a reading section of a book.
/// </summary>
/// <param name="BookId">The Id of the book whose reading section is retrieved. Required.</param>
/// <param name="LocationRef">The opaque location reference of the reading section. Required.</param>
[DebuggerDisplay("BookId: {BookId}, LocationRef: {LocationRef}")]
public sealed record GetReadingSectionRequest(
Guid BookId,
string LocationRef
);