Adds the music metadata data transfer objects, their requests and responses, and extends the artwork data transfer object

This commit is contained in:
BinaryAlley committed 2026-10-06 20:38:00 +03:00
1 parent 5529e99024
commit a939d8fd5f
48 files changed
+1961 -161

No files matched your search

@@ -25,7 +25,7 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class AddAlbumRequestFixture
{
private readonly Faker _faker = new();
private readonly AlbumMetadataDtoFixture _albumMetadataDtoFixture = new();
private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new();
private readonly AddTrackRequestFixture _addTrackRequestFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
@@ -35,8 +35,11 @@ public class AddAlbumRequestFixture
/// </summary>
/// <param name="metadata">Optional. The album metadata of the album.</param>
/// <param name="mediaFormat">Optional. The physical or digital medium of the album.</param>
/// <param name="packaging">Optional. The outermost physical packaging of the album.</param>
/// <param name="barcode">Optional. The barcode of the album.</param>
/// <param name="catalogNumber">Optional. The catalog number of the album.</param>
/// <param name="label">Optional. The name of the label that issued the album.</param>
/// <param name="asin">Optional. The ASIN of the album.</param>
/// <param name="musicBrainzReleaseId">Optional. The MusicBrainz identifier of the release.</param>
/// <param name="musicBrainzReleaseGroupId">Optional. The MusicBrainz identifier of the release group.</param>
/// <param name="musicBrainzReleaseArtistId">Optional. The MusicBrainz identifier of the release artist.</param>
@@ -48,17 +51,23 @@ public class AddAlbumRequestFixture
/// <param name="includeRatings">Whether the ratings list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeTracks">Whether the tracks list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMediaFormat">Whether the media format should be included, or forced to <see langword="null"/>.</param>
/// <param name="includePackaging">Whether the packaging should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeBarcode">Whether the barcode should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumber">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumbers">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeLabel">Whether the label should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAsin">Whether the ASIN should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseId">Whether the MusicBrainz release Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseGroupId">Whether the MusicBrainz release group Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseArtistId">Whether the MusicBrainz release artist Id should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created request to add an album.</returns>
public AddAlbumRequest Create(
AlbumMetadataDto? metadata = null,
MusicAlbumMetadataDto? metadata = null,
MusicMediaFormat? mediaFormat = null,
MusicReleasePackaging? packaging = null,
string? barcode = null,
string? catalogNumber = null,
List<string>? catalogNumbers = null,
string? label = null,
string? asin = null,
Guid? musicBrainzReleaseId = null,
Guid? musicBrainzReleaseGroupId = null,
Guid? musicBrainzReleaseArtistId = null,
@@ -70,17 +79,23 @@ public class AddAlbumRequestFixture
bool includeRatings = true,
bool includeTracks = true,
bool includeMediaFormat = true,
bool includePackaging = true,
bool includeBarcode = true,
bool includeCatalogNumber = true,
bool includeCatalogNumbers = true,
bool includeLabel = true,
bool includeAsin = true,
bool includeMusicBrainzReleaseId = true,
bool includeMusicBrainzReleaseGroupId = true,
bool includeMusicBrainzReleaseArtistId = true)
{
return new AddAlbumRequest(
includeMetadata ? (metadata ?? _albumMetadataDtoFixture.Create()) : null,
includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null,
includeMediaFormat ? (mediaFormat ?? _faker.PickRandom<MusicMediaFormat>()) : null,
includePackaging ? (packaging ?? _faker.PickRandom<MusicReleasePackaging>()) : null,
includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null,
includeCatalogNumber ? (catalogNumber ?? _faker.Random.AlphaNumeric(10)) : null,
includeCatalogNumbers ? (catalogNumbers ?? [_faker.Random.AlphaNumeric(10)]) : null,
includeLabel ? (label ?? _faker.Company.CompanyName()) : null,
includeAsin ? (asin ?? _faker.Random.AlphaNumeric(10)) : null,
includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null,
@@ -23,7 +23,7 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class UpdateAlbumRequestFixture
{
private readonly Faker _faker = new();
private readonly AlbumMetadataDtoFixture _albumMetadataDtoFixture = new();
private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
@@ -32,8 +32,11 @@ public class UpdateAlbumRequestFixture
/// </summary>
/// <param name="metadata">Optional. The album metadata of the album.</param>
/// <param name="mediaFormat">Optional. The physical or digital medium of the album.</param>
/// <param name="packaging">Optional. The outermost physical packaging of the album.</param>
/// <param name="barcode">Optional. The barcode of the album.</param>
/// <param name="catalogNumber">Optional. The catalog number of the album.</param>
/// <param name="label">Optional. The name of the label that issued the album.</param>
/// <param name="asin">Optional. The ASIN of the album.</param>
/// <param name="musicBrainzReleaseId">Optional. The MusicBrainz identifier of the release.</param>
/// <param name="musicBrainzReleaseGroupId">Optional. The MusicBrainz identifier of the release group.</param>
/// <param name="musicBrainzReleaseArtistId">Optional. The MusicBrainz identifier of the release artist.</param>
@@ -43,17 +46,23 @@ public class UpdateAlbumRequestFixture
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeRatings">Whether the ratings list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMediaFormat">Whether the media format should be included, or forced to <see langword="null"/>.</param>
/// <param name="includePackaging">Whether the packaging should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeBarcode">Whether the barcode should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumber">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumbers">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeLabel">Whether the label should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAsin">Whether the ASIN should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseId">Whether the MusicBrainz release Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseGroupId">Whether the MusicBrainz release group Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseArtistId">Whether the MusicBrainz release artist Id should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created request to update an album.</returns>
public UpdateAlbumRequest Create(
AlbumMetadataDto? metadata = null,
MusicAlbumMetadataDto? metadata = null,
MusicMediaFormat? mediaFormat = null,
MusicReleasePackaging? packaging = null,
string? barcode = null,
string? catalogNumber = null,
List<string>? catalogNumbers = null,
string? label = null,
string? asin = null,
Guid? musicBrainzReleaseId = null,
Guid? musicBrainzReleaseGroupId = null,
Guid? musicBrainzReleaseArtistId = null,
@@ -63,17 +72,23 @@ public class UpdateAlbumRequestFixture
bool includeContributors = true,
bool includeRatings = true,
bool includeMediaFormat = true,
bool includePackaging = true,
bool includeBarcode = true,
bool includeCatalogNumber = true,
bool includeCatalogNumbers = true,
bool includeLabel = true,
bool includeAsin = true,
bool includeMusicBrainzReleaseId = true,
bool includeMusicBrainzReleaseGroupId = true,
bool includeMusicBrainzReleaseArtistId = true)
{
return new UpdateAlbumRequest(
includeMetadata ? (metadata ?? _albumMetadataDtoFixture.Create()) : null,
includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null,
includeMediaFormat ? (mediaFormat ?? _faker.PickRandom<MusicMediaFormat>()) : null,
includePackaging ? (packaging ?? _faker.PickRandom<MusicReleasePackaging>()) : null,
includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null,
includeCatalogNumber ? (catalogNumber ?? _faker.Random.AlphaNumeric(10)) : null,
includeCatalogNumbers ? (catalogNumbers ?? [_faker.Random.AlphaNumeric(10)]) : null,
includeLabel ? (label ?? _faker.Company.CompanyName()) : null,
includeAsin ? (asin ?? _faker.Random.AlphaNumeric(10)) : null,
includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null,
@@ -1,7 +1,11 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
@@ -20,40 +24,57 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class AddArtistRequestFixture
{
private readonly Faker _faker = new();
private readonly MusicArtistMetadataDtoFixture _musicArtistMetadataDtoFixture = new();
private readonly AddAlbumRequestFixture _addAlbumRequestFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
/// <summary>
/// Creates a random valid request to add an artist.
/// </summary>
/// <param name="name">Optional. The name of the artist.</param>
/// <param name="metadata">Optional. The metadata of the artist.</param>
/// <param name="website">Optional. The website of the artist.</param>
/// <param name="musicBrainzArtistId">Optional. The MusicBrainz identifier of the artist.</param>
/// <param name="ipis">Optional. The IPI codes of the artist.</param>
/// <param name="isnis">Optional. The ISNI codes of the artist.</param>
/// <param name="contributors">Optional. The media contributors that make up the artist.</param>
/// <param name="ratings">Optional. The ratings of the artist.</param>
/// <param name="albums">Optional. The albums of the artist.</param>
/// <param name="includeName">Whether the name should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMetadata">Whether the metadata should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeWebsite">Whether the website should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzArtistId">Whether the MusicBrainz artist Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIpis">Whether the IPI codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsnis">Whether the ISNI codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeRatings">Whether the ratings list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAlbums">Whether the albums list should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created request to add an artist.</returns>
public AddArtistRequest Create(
string? name = null,
MusicArtistMetadataDto? metadata = null,
string? website = null,
Guid? musicBrainzArtistId = null,
List<string>? ipis = null,
List<string>? isnis = null,
List<MediaContributorReferenceDto>? contributors = null,
List<AudioRatingDto>? ratings = null,
List<AddAlbumRequest>? albums = null,
bool includeName = true,
bool includeMetadata = true,
bool includeWebsite = true,
bool includeMusicBrainzArtistId = true,
bool includeIpis = true,
bool includeIsnis = true,
bool includeContributors = true,
bool includeRatings = true,
bool includeAlbums = true)
{
return new AddArtistRequest(
includeName ? (name ?? _faker.Name.FullName()) : null,
includeMetadata ? (metadata ?? _musicArtistMetadataDtoFixture.Create()) : null,
includeWebsite ? (website ?? _faker.Internet.Url()) : null,
includeMusicBrainzArtistId ? (musicBrainzArtistId ?? _faker.Random.Guid()) : null,
includeIpis ? (ipis ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 2)).Select(_ => _faker.Random.AlphaNumeric(9))]) : null,
includeIsnis ? (isnis ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 2)).Select(_ => _faker.Random.AlphaNumeric(16))]) : null,
includeContributors ? (contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))) : null,
includeRatings ? (ratings ?? _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))) : null,
includeAlbums ? (albums ?? _addAlbumRequestFixture.CreateMany(_faker.Random.Int(1, 3))) : null);
}
@@ -6,7 +6,6 @@ using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
@@ -24,7 +23,7 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class UpdateArtistAlbumRequestFixture
{
private readonly Faker _faker = new();
private readonly AlbumMetadataDtoFixture _albumMetadataDtoFixture = new();
private readonly MusicAlbumMetadataDtoFixture _musicAlbumMetadataDtoFixture = new();
private readonly UpdateArtistTrackRequestFixture _updateArtistTrackRequestFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
@@ -35,8 +34,11 @@ public class UpdateArtistAlbumRequestFixture
/// <param name="albumId">Optional. The Id of the album, when the album already exists.</param>
/// <param name="metadata">Optional. The album metadata of the album.</param>
/// <param name="mediaFormat">Optional. The physical or digital medium of the album.</param>
/// <param name="packaging">Optional. The outermost physical packaging of the album.</param>
/// <param name="barcode">Optional. The barcode of the album.</param>
/// <param name="catalogNumber">Optional. The catalog number of the album.</param>
/// <param name="label">Optional. The name of the label that issued the album.</param>
/// <param name="asin">Optional. The ASIN of the album.</param>
/// <param name="musicBrainzReleaseId">Optional. The MusicBrainz identifier of the release.</param>
/// <param name="musicBrainzReleaseGroupId">Optional. The MusicBrainz identifier of the release group.</param>
/// <param name="musicBrainzReleaseArtistId">Optional. The MusicBrainz identifier of the release artist.</param>
@@ -46,8 +48,11 @@ public class UpdateArtistAlbumRequestFixture
/// <param name="includeAlbumId">Whether the album Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMetadata">Whether the metadata should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMediaFormat">Whether the media format should be included, or forced to <see langword="null"/>.</param>
/// <param name="includePackaging">Whether the packaging should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeBarcode">Whether the barcode should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumber">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCatalogNumbers">Whether the catalog number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeLabel">Whether the label should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAsin">Whether the ASIN should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseId">Whether the MusicBrainz release Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseGroupId">Whether the MusicBrainz release group Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzReleaseArtistId">Whether the MusicBrainz release artist Id should be included, or forced to <see langword="null"/>.</param>
@@ -57,10 +62,13 @@ public class UpdateArtistAlbumRequestFixture
/// <returns>The created request to update an album of an artist.</returns>
public UpdateArtistAlbumRequest Create(
Guid? albumId = null,
AlbumMetadataDto? metadata = null,
MusicAlbumMetadataDto? metadata = null,
MusicMediaFormat? mediaFormat = null,
MusicReleasePackaging? packaging = null,
string? barcode = null,
string? catalogNumber = null,
List<string>? catalogNumbers = null,
string? label = null,
string? asin = null,
Guid? musicBrainzReleaseId = null,
Guid? musicBrainzReleaseGroupId = null,
Guid? musicBrainzReleaseArtistId = null,
@@ -70,8 +78,11 @@ public class UpdateArtistAlbumRequestFixture
bool includeAlbumId = true,
bool includeMetadata = true,
bool includeMediaFormat = true,
bool includePackaging = true,
bool includeBarcode = true,
bool includeCatalogNumber = true,
bool includeCatalogNumbers = true,
bool includeLabel = true,
bool includeAsin = true,
bool includeMusicBrainzReleaseId = true,
bool includeMusicBrainzReleaseGroupId = true,
bool includeMusicBrainzReleaseArtistId = true,
@@ -81,10 +92,13 @@ public class UpdateArtistAlbumRequestFixture
{
return new UpdateArtistAlbumRequest(
includeAlbumId ? (albumId ?? _faker.Random.Guid()) : null,
includeMetadata ? (metadata ?? _albumMetadataDtoFixture.Create()) : null,
includeMetadata ? (metadata ?? _musicAlbumMetadataDtoFixture.Create()) : null,
includeMediaFormat ? (mediaFormat ?? _faker.PickRandom<MusicMediaFormat>()) : null,
includePackaging ? (packaging ?? _faker.PickRandom<MusicReleasePackaging>()) : null,
includeBarcode ? (barcode ?? _faker.Random.String2(13, "0123456789")) : null,
includeCatalogNumber ? (catalogNumber ?? _faker.Random.String2(_faker.Random.Number(1, 50))) : null,
includeCatalogNumbers ? (catalogNumbers ?? [_faker.Random.String2(_faker.Random.Number(1, 50))]) : null,
includeLabel ? (label ?? _faker.Company.CompanyName()) : null,
includeAsin ? (asin ?? _faker.Random.AlphaNumeric(10)) : null,
includeMusicBrainzReleaseId ? (musicBrainzReleaseId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseGroupId ? (musicBrainzReleaseGroupId ?? _faker.Random.Guid()) : null,
includeMusicBrainzReleaseArtistId ? (musicBrainzReleaseArtistId ?? _faker.Random.Guid()) : null,
@@ -1,7 +1,11 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Contracts.DTO.MediaContributors;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
using System;
using System.Collections.Generic;
@@ -18,40 +22,57 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class UpdateArtistRequestFixture
{
private readonly Faker _faker = new();
private readonly MusicArtistMetadataDtoFixture _musicArtistMetadataDtoFixture = new();
private readonly UpdateArtistAlbumRequestFixture _updateArtistAlbumRequestFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
/// <summary>
/// Creates a random valid request to update an artist.
/// </summary>
/// <param name="name">Optional. The name of the artist.</param>
/// <param name="metadata">Optional. The metadata of the artist.</param>
/// <param name="website">Optional. The website of the artist.</param>
/// <param name="musicBrainzArtistId">Optional. The MusicBrainz identifier of the artist.</param>
/// <param name="ipis">Optional. The IPI codes of the artist.</param>
/// <param name="isnis">Optional. The ISNI codes of the artist.</param>
/// <param name="contributors">Optional. The media contributors that make up the artist.</param>
/// <param name="ratings">Optional. The ratings of the artist.</param>
/// <param name="albums">Optional. The albums of the artist.</param>
/// <param name="includeName">Whether the name should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMetadata">Whether the metadata should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeWebsite">Whether the website should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzArtistId">Whether the MusicBrainz artist Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIpis">Whether the IPI codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsnis">Whether the ISNI codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeRatings">Whether the ratings list should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAlbums">Whether the albums list should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created request to update an artist.</returns>
public UpdateArtistRequest Create(
string? name = null,
MusicArtistMetadataDto? metadata = null,
string? website = null,
Guid? musicBrainzArtistId = null,
List<string>? ipis = null,
List<string>? isnis = null,
List<MediaContributorReferenceDto>? contributors = null,
List<AudioRatingDto>? ratings = null,
List<UpdateArtistAlbumRequest>? albums = null,
bool includeName = true,
bool includeMetadata = true,
bool includeWebsite = true,
bool includeMusicBrainzArtistId = true,
bool includeIpis = true,
bool includeIsnis = true,
bool includeContributors = true,
bool includeRatings = true,
bool includeAlbums = true)
{
return new UpdateArtistRequest(
includeName ? (name ?? _faker.Name.FullName()) : null,
includeMetadata ? (metadata ?? _musicArtistMetadataDtoFixture.Create()) : null,
includeWebsite ? (website ?? _faker.Internet.Url()) : null,
includeMusicBrainzArtistId ? (musicBrainzArtistId ?? _faker.Random.Guid()) : null,
includeIpis ? (ipis ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 2)).Select(_ => _faker.Random.AlphaNumeric(9))]) : null,
includeIsnis ? (isnis ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 2)).Select(_ => _faker.Random.AlphaNumeric(16))]) : null,
includeContributors ? (contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))) : null,
includeRatings ? (ratings ?? _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))) : null,
includeAlbums ? (albums ?? _updateArtistAlbumRequestFixture.CreateMany(_faker.Random.Int(1, 3))) : null);
}
@@ -26,7 +26,8 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class UpdateArtistTrackRequestFixture
{
private readonly Faker _faker = new();
private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new();
private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new();
private readonly MoodDtoFixture _moodDtoFixture = new();
private readonly IsrcDtoFixture _isrcDtoFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
@@ -43,10 +44,9 @@ public class UpdateArtistTrackRequestFixture
/// <param name="script">Optional. The script used by the language of the track.</param>
/// <param name="key">Optional. The musical key of the track.</param>
/// <param name="bpm">Optional. The tempo of the track in beats per minute.</param>
/// <param name="work">Optional. The title of the work the track is a recording of.</param>
/// <param name="work">Optional. The work the track is a recording of.</param>
/// <param name="musicBrainzRecordingId">Optional. The MusicBrainz identifier of the recording.</param>
/// <param name="musicBrainzTrackId">Optional. The MusicBrainz identifier of the track.</param>
/// <param name="musicBrainzWorkId">Optional. The MusicBrainz identifier of the work.</param>
/// <param name="moods">Optional. The moods of the track.</param>
/// <param name="isrcs">Optional. The ISRC codes of the track.</param>
/// <param name="contributors">Optional. The media contributors that performed on the track.</param>
@@ -62,7 +62,6 @@ public class UpdateArtistTrackRequestFixture
/// <param name="includeWork">Whether the work should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzRecordingId">Whether the MusicBrainz recording Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzTrackId">Whether the MusicBrainz track Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzWorkId">Whether the MusicBrainz work Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMoods">Whether the moods should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsrcs">Whether the ISRC codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
@@ -71,16 +70,15 @@ public class UpdateArtistTrackRequestFixture
public UpdateArtistTrackRequest Create(
Guid? trackId = null,
string? path = null,
AudioMetadataDto? metadata = null,
MusicTrackMetadataDto? metadata = null,
int? trackNumber = null,
int? discNumber = null,
string? script = null,
MusicKey? key = null,
int? bpm = null,
string? work = null,
MusicWorkDto? work = null,
Guid? musicBrainzRecordingId = null,
Guid? musicBrainzTrackId = null,
Guid? musicBrainzWorkId = null,
List<MoodDto>? moods = null,
List<IsrcDto>? isrcs = null,
List<MediaContributorReferenceDto>? contributors = null,
@@ -96,7 +94,6 @@ public class UpdateArtistTrackRequestFixture
bool includeWork = true,
bool includeMusicBrainzRecordingId = true,
bool includeMusicBrainzTrackId = true,
bool includeMusicBrainzWorkId = true,
bool includeMoods = true,
bool includeIsrcs = true,
bool includeContributors = true,
@@ -105,16 +102,15 @@ public class UpdateArtistTrackRequestFixture
return new UpdateArtistTrackRequest(
includeTrackId ? (trackId ?? _faker.Random.Guid()) : null,
includePath ? (path ?? Path.Combine(Path.GetTempPath(), "lumina-tracks", _faker.System.FileName())) : null,
includeMetadata ? (metadata ?? _audioMetadataDtoFixture.Create()) : null,
includeMetadata ? (metadata ?? _musicTrackMetadataDtoFixture.Create()) : null,
includeTrackNumber ? (trackNumber ?? _faker.Random.Int(1, 30)) : null,
includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null,
includeScript ? (script ?? _faker.Random.AlphaNumeric(4)) : null,
includeKey ? (key ?? _faker.PickRandom<MusicKey>()) : null,
includeBpm ? (bpm ?? _faker.Random.Int(40, 220)) : null,
includeWork ? (work ?? _faker.Lorem.Sentence()) : null,
includeWork ? (work ?? _musicWorkDtoFixture.Create()) : null,
includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null,
includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null,
includeMusicBrainzWorkId ? (musicBrainzWorkId ?? _faker.Random.Guid()) : null,
includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
@@ -26,7 +26,8 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class AddTrackRequestFixture
{
private readonly Faker _faker = new();
private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new();
private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new();
private readonly MoodDtoFixture _moodDtoFixture = new();
private readonly IsrcDtoFixture _isrcDtoFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
@@ -42,10 +43,9 @@ public class AddTrackRequestFixture
/// <param name="script">Optional. The script used by the language of the track.</param>
/// <param name="key">Optional. The musical key of the track.</param>
/// <param name="bpm">Optional. The tempo of the track in beats per minute.</param>
/// <param name="work">Optional. The title of the work the track is a recording of.</param>
/// <param name="work">Optional. The work the track is a recording of.</param>
/// <param name="musicBrainzRecordingId">Optional. The MusicBrainz identifier of the recording.</param>
/// <param name="musicBrainzTrackId">Optional. The MusicBrainz identifier of the track.</param>
/// <param name="musicBrainzWorkId">Optional. The MusicBrainz identifier of the work.</param>
/// <param name="moods">Optional. The list of moods of the track.</param>
/// <param name="isrcs">Optional. The list of ISRC of the track.</param>
/// <param name="contributors">Optional. The list of media contributors that performed on the track.</param>
@@ -60,7 +60,6 @@ public class AddTrackRequestFixture
/// <param name="includeWork">Whether the work should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzRecordingId">Whether the MusicBrainz recording Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzTrackId">Whether the MusicBrainz track Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzWorkId">Whether the MusicBrainz work Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMoods">Whether the moods should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsrcs">Whether the ISRC codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors should be included, or forced to <see langword="null"/>.</param>
@@ -68,16 +67,15 @@ public class AddTrackRequestFixture
/// <returns>The created request to add a track.</returns>
public AddTrackRequest Create(
string? path = null,
AudioMetadataDto? metadata = null,
MusicTrackMetadataDto? metadata = null,
int? trackNumber = null,
int? discNumber = null,
string? script = null,
MusicKey? key = null,
int? bpm = null,
string? work = null,
MusicWorkDto? work = null,
Guid? musicBrainzRecordingId = null,
Guid? musicBrainzTrackId = null,
Guid? musicBrainzWorkId = null,
List<MoodDto>? moods = null,
List<IsrcDto>? isrcs = null,
List<MediaContributorReferenceDto>? contributors = null,
@@ -92,7 +90,6 @@ public class AddTrackRequestFixture
bool includeWork = true,
bool includeMusicBrainzRecordingId = true,
bool includeMusicBrainzTrackId = true,
bool includeMusicBrainzWorkId = true,
bool includeMoods = true,
bool includeIsrcs = true,
bool includeContributors = true,
@@ -100,16 +97,15 @@ public class AddTrackRequestFixture
{
return new AddTrackRequest(
includePath ? path ?? Path.Combine(Path.GetTempPath(), "lumina-tracks", _faker.System.FileName()) : null,
includeMetadata ? metadata ?? _audioMetadataDtoFixture.Create() : null,
includeMetadata ? metadata ?? _musicTrackMetadataDtoFixture.Create() : null,
includeTrackNumber ? trackNumber ?? _faker.Random.Int(1, 30) : null,
includeDiscNumber ? discNumber ?? _faker.Random.Int(1, 3) : null,
includeScript ? script ?? _faker.Random.AlphaNumeric(4) : null,
includeKey ? key ?? _faker.PickRandom<MusicKey>() : null,
includeBpm ? bpm ?? _faker.Random.Int(40, 220) : null,
includeWork ? work ?? _faker.Lorem.Sentence() : null,
includeWork ? work ?? _musicWorkDtoFixture.Create() : null,
includeMusicBrainzRecordingId ? musicBrainzRecordingId ?? _faker.Random.Guid() : null,
includeMusicBrainzTrackId ? musicBrainzTrackId ?? _faker.Random.Guid() : null,
includeMusicBrainzWorkId ? musicBrainzWorkId ?? _faker.Random.Guid() : null,
includeMoods ? moods ?? _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
includeIsrcs ? isrcs ?? _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
includeContributors ? contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
@@ -25,7 +25,8 @@ namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.Musi
public class UpdateTrackRequestFixture
{
private readonly Faker _faker = new();
private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
private readonly MusicTrackMetadataDtoFixture _musicTrackMetadataDtoFixture = new();
private readonly MusicWorkDtoFixture _musicWorkDtoFixture = new();
private readonly MoodDtoFixture _moodDtoFixture = new();
private readonly IsrcDtoFixture _isrcDtoFixture = new();
private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
@@ -41,10 +42,9 @@ public class UpdateTrackRequestFixture
/// <param name="script">Optional. The script used by the language of the track.</param>
/// <param name="key">Optional. The musical key of the track.</param>
/// <param name="bpm">Optional. The tempo of the track in beats per minute.</param>
/// <param name="work">Optional. The title of the work the track is a recording of.</param>
/// <param name="work">Optional. The work the track is a recording of.</param>
/// <param name="musicBrainzRecordingId">Optional. The MusicBrainz identifier of the recording.</param>
/// <param name="musicBrainzTrackId">Optional. The MusicBrainz identifier of the track.</param>
/// <param name="musicBrainzWorkId">Optional. The MusicBrainz identifier of the work.</param>
/// <param name="moods">Optional. The moods of the track.</param>
/// <param name="isrcs">Optional. The ISRC codes of the track.</param>
/// <param name="contributors">Optional. The media contributors that performed on the track.</param>
@@ -56,7 +56,6 @@ public class UpdateTrackRequestFixture
/// <param name="includeWork">Whether the work should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzRecordingId">Whether the MusicBrainz recording Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzTrackId">Whether the MusicBrainz track Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMusicBrainzWorkId">Whether the MusicBrainz work Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeMoods">Whether the moods should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsrcs">Whether the ISRC codes should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
@@ -67,16 +66,15 @@ public class UpdateTrackRequestFixture
/// <returns>The created request to update a track.</returns>
public UpdateTrackRequest Create(
string? path = null,
AudioMetadataDto? metadata = null,
MusicTrackMetadataDto? metadata = null,
int? trackNumber = null,
int? discNumber = null,
string? script = null,
MusicKey? key = null,
int? bpm = null,
string? work = null,
MusicWorkDto? work = null,
Guid? musicBrainzRecordingId = null,
Guid? musicBrainzTrackId = null,
Guid? musicBrainzWorkId = null,
List<MoodDto>? moods = null,
List<IsrcDto>? isrcs = null,
List<MediaContributorReferenceDto>? contributors = null,
@@ -88,7 +86,6 @@ public class UpdateTrackRequestFixture
bool includeWork = true,
bool includeMusicBrainzRecordingId = true,
bool includeMusicBrainzTrackId = true,
bool includeMusicBrainzWorkId = true,
bool includeMoods = true,
bool includeIsrcs = true,
bool includeContributors = true,
@@ -99,16 +96,15 @@ public class UpdateTrackRequestFixture
{
return new UpdateTrackRequest(
includePath ? (path ?? _faker.System.FilePath()) : null,
includeMetadata ? (metadata ?? _audioMetadataDtoFixture.Create()) : null,
includeMetadata ? (metadata ?? _musicTrackMetadataDtoFixture.Create()) : null,
includeTrackNumber ? (trackNumber ?? _faker.Random.Int(1, 20)) : null,
includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null,
includeScript ? (script ?? _faker.Random.String2(_faker.Random.Number(1, 50))) : null,
includeKey ? (key ?? _faker.PickRandom<MusicKey>()) : null,
includeBpm ? (bpm ?? _faker.Random.Int(40, 240)) : null,
includeWork ? (work ?? _faker.Music.Genre()) : null,
includeWork ? (work ?? _musicWorkDtoFixture.Create()) : null,
includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null,
includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null,
includeMusicBrainzWorkId ? (musicBrainzWorkId ?? _faker.Random.Guid()) : null,
includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,