Extends the music library listings with covers, sorting and alpha filtering.

This commit is contained in:
BinaryAlley committed 2026-10-13 13:26:14 +03:00
1 parent 0019821e87
commit 9d82f283e4
69 files changed
+3613 -268

No files matched your search

@@ -1,6 +1,7 @@
#region ========================================================================= USING =====================================================================================
using Bogus;
using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@@ -15,6 +16,9 @@ namespace Lumina.Application.Fixtures.Common.DTO.MediaLibrary.AudioLibrary.Music
[ExcludeFromCodeCoverage]
public class AlbumLiteRowFixture
{
private const int MINIMUM_RELEASE_YEAR = 1900;
private const int MAXIMUM_RELEASE_YEAR = 2026;
private readonly Faker _faker = new();
/// <summary>
@@ -23,17 +27,32 @@ public class AlbumLiteRowFixture
/// <param name="id">Optional. The Id of the album.</param>
/// <param name="title">Optional. The title of the album.</param>
/// <param name="totalTracks">Optional. The number of tracks of the release.</param>
/// <param name="coverPath">Optional. The path of the image representing the album.</param>
/// <param name="releaseYear">Optional. The release year of the album.</param>
/// <param name="releaseTypes">Optional. The set of types of the release.</param>
/// <param name="includeCoverPath">Whether the cover path should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeReleaseYear">Whether the release year should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeReleaseTypes">Whether the release types should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created <see cref="AlbumLiteRow"/>.</returns>
public AlbumLiteRow Create(
Guid? id = null,
string? title = null,
int? totalTracks = null)
int? totalTracks = null,
string? coverPath = null,
int? releaseYear = null,
List<MusicReleaseType>? releaseTypes = null,
bool includeCoverPath = true,
bool includeReleaseYear = true,
bool includeReleaseTypes = true)
{
return new AlbumLiteRow
{
Id = id ?? _faker.Random.Guid(),
Title = title ?? _faker.Music.Genre(),
TotalTracks = totalTracks ?? _faker.Random.Int(1, 30)
TotalTracks = totalTracks ?? _faker.Random.Int(1, 30),
CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null,
ReleaseYear = includeReleaseYear ? (releaseYear ?? _faker.Random.Int(MINIMUM_RELEASE_YEAR, MAXIMUM_RELEASE_YEAR)) : null,
ReleaseTypes = includeReleaseTypes ? (releaseTypes ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 3)).Select(index => _faker.PickRandom<MusicReleaseType>())]) : null
};
}
@@ -22,15 +22,20 @@ public class ArtistLiteRowFixture
/// </summary>
/// <param name="id">Optional. The Id of the artist.</param>
/// <param name="name">Optional. The name of the artist.</param>
/// <param name="coverPath">Optional. The path of the image representing the artist.</param>
/// <param name="includeCoverPath">Whether the cover path should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created <see cref="ArtistLiteRow"/>.</returns>
public ArtistLiteRow Create(
Guid? id = null,
string? name = null)
string? name = null,
string? coverPath = null,
bool includeCoverPath = true)
{
return new ArtistLiteRow
{
Id = id ?? _faker.Random.Guid(),
Name = name ?? _faker.Name.FullName()
Name = name ?? _faker.Name.FullName(),
CoverPath = includeCoverPath ? (coverPath ?? _faker.System.FilePath()) : null
};
}
@@ -25,20 +25,23 @@ public class TrackLiteRowFixture
/// <param name="trackNumber">Optional. The number of the track on its disc.</param>
/// <param name="discNumber">Optional. The number of the disc the track belongs to.</param>
/// <param name="includeDiscNumber">Whether the disc number should be included, or forced to <see langword="null"/>.</param>
/// <param name="durationInSeconds">Optional. The duration of the track in seconds.</param>
/// <returns>The created <see cref="TrackLiteRow"/>.</returns>
public TrackLiteRow Create(
Guid? id = null,
string? title = null,
int? trackNumber = null,
int? discNumber = null,
bool includeDiscNumber = true)
bool includeDiscNumber = true,
int? durationInSeconds = null)
{
return new TrackLiteRow
{
Id = id ?? _faker.Random.Guid(),
Title = title ?? _faker.Lorem.Sentence(),
TrackNumber = trackNumber ?? _faker.Random.Int(1, 30),
DiscNumber = includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null
DiscNumber = includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null,
DurationInSeconds = durationInSeconds ?? _faker.Random.Int(1, 600)
};
}