mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
Adds the music library persistence model, its repositories, and the scanning migration
This commit is contained in:
1 parent
4f0526faa4
commit
00376c8313
63 files changed
+8679
-203
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for a catalog number of a music release. A release can carry more than one catalog number at the same time.
|
||||
/// </summary>
|
||||
/// <param name="CatalogNumber">The catalog number assigned by the label.</param>
|
||||
[DebuggerDisplay("CatalogNumber: {CatalogNumber}")]
|
||||
public record AlbumCatalogNumberEntity(
|
||||
string CatalogNumber
|
||||
);
|
||||
+50
-4
@@ -2,6 +2,7 @@
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -40,11 +41,21 @@ public class AlbumEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public string? OriginalTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title of the specific release (edition) the album files match, if different from the release group title.
|
||||
/// </summary>
|
||||
public string? ReleaseTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the description of the album, if applicable.
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the disambiguation comment of the album, used to distinguish albums with the same title, if applicable.
|
||||
/// </summary>
|
||||
public string? Disambiguation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original release date of the album, if applicable.
|
||||
/// </summary>
|
||||
@@ -106,9 +117,9 @@ public class AlbumEntity : IStorageEntity, IAuditableEntity
|
||||
public string? OriginalLanguageNativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the release, if applicable.
|
||||
/// Gets or sets the script used by the language of the release of the album, if applicable.
|
||||
/// </summary>
|
||||
public MusicReleaseType? ReleaseType { get; set; }
|
||||
public string? Script { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status of the release, if applicable.
|
||||
@@ -130,15 +141,30 @@ public class AlbumEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public MusicMediaFormat? MediaFormat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outermost physical packaging of the album, if applicable.
|
||||
/// </summary>
|
||||
public MusicReleasePackaging? Packaging { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the barcode of the album, if applicable.
|
||||
/// </summary>
|
||||
public string? Barcode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the catalog number of the album, if applicable.
|
||||
/// Gets or sets the catalog numbers of the album.
|
||||
/// </summary>
|
||||
public string? CatalogNumber { get; set; }
|
||||
public List<AlbumCatalogNumberEntity> CatalogNumbers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the label that issued the album, if applicable.
|
||||
/// </summary>
|
||||
public string? Label { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ASIN (Amazon Standard Identification Number) of the album, if applicable.
|
||||
/// </summary>
|
||||
public string? ASIN { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MusicBrainz identifier of the release, if applicable.
|
||||
@@ -175,6 +201,11 @@ public class AlbumEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public List<AlbumContributorEntity> Contributors { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the types of the release. A release can carry more than one type at the same time.
|
||||
/// </summary>
|
||||
public List<AlbumReleaseTypeEntity> ReleaseTypes { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the genres of the album.
|
||||
/// </summary>
|
||||
@@ -185,6 +216,21 @@ public class AlbumEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public HashSet<TagEntity> Tags { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status of the metadata enrichment of the album.
|
||||
/// </summary>
|
||||
public MetadataStatus MetadataStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the metadata of the album was last enriched.
|
||||
/// </summary>
|
||||
public DateTime? LastMetadataUpdateUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the plugin that enriched the metadata of the album.
|
||||
/// </summary>
|
||||
public string? MetadataProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time and date when the entity was added.
|
||||
/// </summary>
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for a type of a music release. A release can carry more than one type at the same time.
|
||||
/// </summary>
|
||||
/// <param name="ReleaseType">The type of the release.</param>
|
||||
[DebuggerDisplay("ReleaseType: {ReleaseType}")]
|
||||
public record AlbumReleaseTypeEntity(
|
||||
MusicReleaseType ReleaseType
|
||||
);
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for an alternative name of a music artist.
|
||||
/// </summary>
|
||||
/// <param name="Name">The name of the alias.</param>
|
||||
/// <param name="SortName">The sort name of the alias, if applicable.</param>
|
||||
/// <param name="Type">The type of the alias, if applicable.</param>
|
||||
/// <param name="Locale">The locale the alias is used in, if applicable.</param>
|
||||
/// <param name="IsPrimary">Whether this is the primary alias of the artist.</param>
|
||||
/// <param name="BeginDate">The date the alias began being used, if applicable.</param>
|
||||
/// <param name="EndDate">The date the alias stopped being used, if applicable.</param>
|
||||
/// <param name="IsEnded">Whether the alias is no longer used.</param>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public record ArtistAliasEntity(
|
||||
string Name,
|
||||
string? SortName,
|
||||
string? Type,
|
||||
string? Locale,
|
||||
bool IsPrimary,
|
||||
DateOnly? BeginDate,
|
||||
DateOnly? EndDate,
|
||||
bool IsEnded
|
||||
);
|
||||
+101
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -29,6 +30,46 @@ public class ArtistEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sort name of the artist, a variant of the name used when sorting artists, if applicable.
|
||||
/// </summary>
|
||||
public string? SortName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the disambiguation comment of the artist, used to distinguish artists with the same name, if applicable.
|
||||
/// </summary>
|
||||
public string? Disambiguation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the artist, if applicable.
|
||||
/// </summary>
|
||||
public MusicArtistType? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the gender of the artist, applicable only to artists that are persons or characters, if applicable.
|
||||
/// </summary>
|
||||
public MusicArtistGender? Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ISO 3166-1 alpha-2 code of the country the artist is associated with, if applicable.
|
||||
/// </summary>
|
||||
public string? Country { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date the artist started existing, if applicable.
|
||||
/// </summary>
|
||||
public DateOnly? LifeSpanBegin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date the artist stopped existing, if applicable.
|
||||
/// </summary>
|
||||
public DateOnly? LifeSpanEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the artist no longer exists.
|
||||
/// </summary>
|
||||
public bool IsEnded { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the website of the artist, if applicable.
|
||||
/// </summary>
|
||||
@@ -39,6 +80,51 @@ public class ArtistEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzArtistId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the area the artist is primarily identified with, if applicable.
|
||||
/// </summary>
|
||||
public MusicAreaEntity? Area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the area the artist began in, if applicable.
|
||||
/// </summary>
|
||||
public MusicAreaEntity? BeginArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the area the artist ended in, if applicable.
|
||||
/// </summary>
|
||||
public MusicAreaEntity? EndArea { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of alternative names of the artist.
|
||||
/// </summary>
|
||||
public List<ArtistAliasEntity> Aliases { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of IPI (Interested Party Information) codes of the artist.
|
||||
/// </summary>
|
||||
public List<ArtistIpiEntity> Ipis { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of ISNI (International Standard Name Identifier) codes of the artist.
|
||||
/// </summary>
|
||||
public List<ArtistIsniEntity> Isnis { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the genres of the artist.
|
||||
/// </summary>
|
||||
public HashSet<GenreEntity> Genres { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tags of the artist.
|
||||
/// </summary>
|
||||
public HashSet<TagEntity> Tags { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of ratings of the artist.
|
||||
/// </summary>
|
||||
public List<AudioRatingEntity> Ratings { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the albums of the artist.
|
||||
/// </summary>
|
||||
@@ -49,6 +135,21 @@ public class ArtistEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public List<ArtistContributorEntity> Contributors { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status of the metadata enrichment of the artist.
|
||||
/// </summary>
|
||||
public MetadataStatus MetadataStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the metadata of the artist was last enriched.
|
||||
/// </summary>
|
||||
public DateTime? LastMetadataUpdateUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the plugin that enriched the metadata of the artist.
|
||||
/// </summary>
|
||||
public string? MetadataProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time and date when the entity was added.
|
||||
/// </summary>
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for an IPI (Interested Party Information) code of a music artist.
|
||||
/// </summary>
|
||||
/// <param name="Value">The value of the IPI code.</param>
|
||||
[DebuggerDisplay("Value: {Value}")]
|
||||
public record ArtistIpiEntity(
|
||||
string Value
|
||||
);
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for an ISNI (International Standard Name Identifier) code of a music artist.
|
||||
/// </summary>
|
||||
/// <param name="Value">The value of the ISNI code.</param>
|
||||
[DebuggerDisplay("Value: {Value}")]
|
||||
public record ArtistIsniEntity(
|
||||
string Value
|
||||
);
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for a MusicBrainz area, the geographic area a music artist is associated with.
|
||||
/// </summary>
|
||||
/// <param name="MusicBrainzAreaId">The MusicBrainz identifier of the area.</param>
|
||||
/// <param name="Name">The name of the area.</param>
|
||||
/// <param name="SortName">The sort name of the area, if applicable.</param>
|
||||
/// <param name="Disambiguation">The disambiguation comment of the area, if applicable.</param>
|
||||
/// <param name="Type">The MusicBrainz type of the area, if applicable.</param>
|
||||
/// <param name="Iso3166Code">The ISO 3166 code of the area, if applicable.</param>
|
||||
[DebuggerDisplay("Name: {Name}")]
|
||||
public record MusicAreaEntity(
|
||||
Guid MusicBrainzAreaId,
|
||||
string Name,
|
||||
string? SortName,
|
||||
string? Disambiguation,
|
||||
string? Type,
|
||||
string? Iso3166Code
|
||||
);
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for the metadata extracted from a discovered music file, staged during a scan, before the artists, albums and tracks are materialized from it.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Path: {Path}")]
|
||||
public class MusicLibraryScanItemMetadataEntity : IStorageEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Id of the staged music metadata.
|
||||
/// </summary>
|
||||
public required Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Id of the media library scan that this staged music metadata belongs to.
|
||||
/// </summary>
|
||||
public required Guid LibraryScanId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Id of the media library that this staged music metadata belongs to.
|
||||
/// </summary>
|
||||
public required Guid LibraryId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file system path of the music file whose metadata was extracted.
|
||||
/// </summary>
|
||||
public required string Path { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the artist, if applicable.
|
||||
/// </summary>
|
||||
public string? ArtistName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the release, if applicable.
|
||||
/// </summary>
|
||||
public MusicReleaseType? ReleaseType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the release year, if applicable.
|
||||
/// </summary>
|
||||
public int? ReleaseYear { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the release, if applicable.
|
||||
/// </summary>
|
||||
public string? ReleaseName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the track, if applicable.
|
||||
/// </summary>
|
||||
public string? TrackTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of the track on its disc, if applicable.
|
||||
/// </summary>
|
||||
public int? TrackNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of the disc the track belongs to, if applicable.
|
||||
/// </summary>
|
||||
public int? DiscNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the duration of the audio in seconds.
|
||||
/// </summary>
|
||||
public int DurationInSeconds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sample rate of the audio in Hz.
|
||||
/// </summary>
|
||||
public int SampleRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of audio channels.
|
||||
/// </summary>
|
||||
public int Channels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the bit depth of the audio, if applicable.
|
||||
/// </summary>
|
||||
public int? BitDepth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audio codec used, if applicable.
|
||||
/// </summary>
|
||||
public string? AudioCodec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the bitrate of the audio in kbps, if applicable.
|
||||
/// </summary>
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AcoustID fingerprint identifier of the audio file, if applicable.
|
||||
/// </summary>
|
||||
public string? AcoustId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain track gain in decibels, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainTrackGain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain track peak, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainTrackPeak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain album gain in decibels, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainAlbumGain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain album peak, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainAlbumPeak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the moods of the track, read from the tags of the file.
|
||||
/// </summary>
|
||||
public List<string> Moods { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the artist, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzArtistId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the release artist, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzReleaseArtistId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the release group, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzReleaseGroupId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the release, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzReleaseId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the recording, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzRecordingId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the track, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzTrackId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MusicBrainz identifier of the work the track is a recording of, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public Guid? MusicBrainzWorkId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the title of the work the track is a recording of, read from the tags of the file, if applicable.
|
||||
/// </summary>
|
||||
public string? WorkTitle { get; set; }
|
||||
}
|
||||
+67
-1
@@ -2,6 +2,7 @@
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -50,6 +51,11 @@ public class TrackEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public string? Description { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the disambiguation comment of the track, used to distinguish tracks with the same title, if applicable.
|
||||
/// </summary>
|
||||
public string? Disambiguation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the original release date of the track, if applicable.
|
||||
/// </summary>
|
||||
@@ -140,6 +146,31 @@ public class TrackEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AcoustID fingerprint identifier of the audio file, if applicable.
|
||||
/// </summary>
|
||||
public string? AcoustId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain track gain in decibels, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainTrackGain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain track peak, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainTrackPeak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain album gain in decibels, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainAlbumGain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ReplayGain album peak, if applicable.
|
||||
/// </summary>
|
||||
public decimal? ReplayGainAlbumPeak { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of the track on its disc.
|
||||
/// </summary>
|
||||
@@ -165,10 +196,20 @@ public class TrackEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public int? Bpm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the recording of the track is a video recording.
|
||||
/// </summary>
|
||||
public bool IsVideo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the title of the work the track is a recording of, if applicable.
|
||||
/// </summary>
|
||||
public string? Work { get; set; }
|
||||
public string? WorkTitle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MusicBrainz type of the work the track is a recording of, if applicable.
|
||||
/// </summary>
|
||||
public string? WorkType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the MusicBrainz identifier of the recording, if applicable.
|
||||
@@ -200,6 +241,16 @@ public class TrackEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public List<TrackIsrcEntity> Isrcs { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of the languages of the work the track is a recording of.
|
||||
/// </summary>
|
||||
public List<TrackWorkLanguageEntity> WorkLanguages { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of ISWC (International Standard Musical Work Code) of the work the track is a recording of.
|
||||
/// </summary>
|
||||
public List<TrackWorkIswcEntity> WorkIswcs { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of the media contributors of the track.
|
||||
/// </summary>
|
||||
@@ -220,6 +271,21 @@ public class TrackEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public HashSet<TagEntity> Tags { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status of the metadata enrichment of the track.
|
||||
/// </summary>
|
||||
public MetadataStatus MetadataStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time when the metadata of the track was last enriched.
|
||||
/// </summary>
|
||||
public DateTime? LastMetadataUpdateUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the plugin that enriched the metadata of the track.
|
||||
/// </summary>
|
||||
public string? MetadataProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time and date when the entity was added.
|
||||
/// </summary>
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for an ISWC (International Standard Musical Work Code) of the work a track is a recording of.
|
||||
/// </summary>
|
||||
/// <param name="Value">The value of the ISWC.</param>
|
||||
[DebuggerDisplay("Value: {Value}")]
|
||||
public record TrackWorkIswcEntity(
|
||||
string Value
|
||||
);
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Repository entity for a language of the work a track is a recording of.
|
||||
/// </summary>
|
||||
/// <param name="LanguageCode">The ISO 639-1 two-letter language code.</param>
|
||||
/// <param name="LanguageName">The full name of the language in English.</param>
|
||||
/// <param name="NativeName">The native name of the language, if applicable.</param>
|
||||
[DebuggerDisplay("LanguageCode: {LanguageCode}")]
|
||||
public record TrackWorkLanguageEntity(
|
||||
string LanguageCode,
|
||||
string LanguageName,
|
||||
string? NativeName
|
||||
);
|
||||
+1
@@ -2,6 +2,7 @@
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
+5
@@ -47,6 +47,11 @@ public class UserSettingsEntity : IStorageEntity, IAuditableEntity
|
||||
/// </summary>
|
||||
public bool ShouldAggregateMetadataWhenMissing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the artwork of the media library items is aggregated from multiple providers, when it is missing, or not.
|
||||
/// </summary>
|
||||
public bool ShouldAggregateArtworkWhenMissing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether PDF books are rendered as page images for the user, or not. Rendering PDFs as images preserves the
|
||||
/// original layout, but the pages are not selectable or searchable, unlike their text layer.
|
||||
|
||||
@@ -40,6 +40,15 @@ public interface IBookRepository : IRepository<BookEntity>,
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the <see cref="BookEntity"/> stored at the provided path, or an error.</returns>
|
||||
Task<Result<BookEntity?>> GetByPathAsync(Guid libraryId, string path, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the subset of <paramref name="paths"/> that is already used by a book of the library identified by <paramref name="libraryId"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the library whose books are searched.</param>
|
||||
/// <param name="paths">The book paths to check.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the paths that are already used, or an error.</returns>
|
||||
Task<Result<IReadOnlyCollection<string>>> GetExistingPathsAsync(Guid libraryId, IReadOnlyCollection<string> paths, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of the books of the media library identified by <paramref name="libraryId"/> whose metadata has not been enriched yet,
|
||||
/// ordered by path, using keyset pagination.
|
||||
|
||||
+9
@@ -55,6 +55,15 @@ public interface ILibraryScanStagingResultsRepository : IRepository<LibraryScanS
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the paths of the changed staging results, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<string>>> GetChangedPathsAsync(Guid scanId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the paths of the media library scan staging results of the current scan that are new or changed, meaning they need their content hashed
|
||||
/// and their metadata extracted.
|
||||
/// </summary>
|
||||
/// <param name="scanId">The unique identifier of the media library scan whose staging result paths are 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 paths of the staging results that need rehashing, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<string>>> GetPathsNeedingRehashAsync(Guid scanId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the content hashes of the provided media library scan staging results.
|
||||
/// </summary>
|
||||
|
||||
+65
-1
@@ -20,7 +20,8 @@ public interface IAlbumRepository : IRepository<AlbumEntity>,
|
||||
IInsertRepositoryAction<AlbumEntity>,
|
||||
IUpdateRepositoryAction<AlbumEntity>,
|
||||
IApplyUpdateRepositoryAction<AlbumEntity>,
|
||||
IGetByIdRepositoryAction<AlbumEntity, Guid>
|
||||
IGetByIdRepositoryAction<AlbumEntity, Guid>,
|
||||
IDeleteByIdRepositoryAction<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all the albums of the artist identified by <paramref name="artistId"/>.
|
||||
@@ -38,4 +39,67 @@ public interface IAlbumRepository : IRepository<AlbumEntity>,
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a paginated result of <see cref="AlbumLiteRow"/>, or an error.</returns>
|
||||
Task<Result<PaginatedResultDto<AlbumLiteRow>>> GetAlbumsLiteByArtistIdAsync(Guid artistId, PaginationDataDto? paginationData, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the album of the artist identified by <paramref name="artistId"/> that has the provided <paramref name="title"/>.
|
||||
/// </summary>
|
||||
/// <param name="artistId">The Id of the artist whose album is retrieved.</param>
|
||||
/// <param name="title">The title of the album to retrieve.</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="AlbumEntity"/> with the provided title, or an error.</returns>
|
||||
Task<Result<AlbumEntity?>> GetByTitleAsync(Guid artistId, string title, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the album of the artist identified by <paramref name="artistId"/> that owns a track stored in the provided <paramref name="directoryPath"/>.
|
||||
/// </summary>
|
||||
/// <param name="artistId">The Id of the artist whose album is retrieved.</param>
|
||||
/// <param name="directoryPath">The file system path of the album directory the album owns.</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="AlbumEntity"/> owning the directory, or an error.</returns>
|
||||
Task<Result<AlbumEntity?>> GetByTrackDirectoryAsync(Guid artistId, string directoryPath, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of albums of the media library identified by <paramref name="libraryId"/> whose metadata has not been enriched yet.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose albums are counted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the number of albums needing their metadata enriched, or an error.</returns>
|
||||
Task<Result<int>> GetAlbumsNeedingMetadataCountAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of albums of the media library identified by <paramref name="libraryId"/> whose artwork has not been resolved yet,
|
||||
/// meaning they have no artwork that is either enriched or confirmed as unavailable.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose albums are counted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the number of albums needing their artwork resolved, or an error.</returns>
|
||||
Task<Result<int>> GetAlbumsNeedingArtworkCountAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of the albums of the media library identified by <paramref name="libraryId"/> whose artwork has not been resolved yet,
|
||||
/// together with their artist, ordered by Id, excluding the provided albums.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose albums are retrieved.</param>
|
||||
/// <param name="excludedAlbumIds">The Ids of the albums that were already processed in the current run and must not be retrieved again.</param>
|
||||
/// <param name="pageSize">The maximum number of albums to retrieve.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a page of albums needing their artwork resolved, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<AlbumEntity>>> GetAlbumsNeedingArtworkAsync(Guid libraryId, IReadOnlyCollection<Guid> excludedAlbumIds, int pageSize, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file system path of one track of each of the albums identified by <paramref name="albumIds"/>, keyed by the Id of the album.
|
||||
/// </summary>
|
||||
/// <param name="albumIds">The Ids of the albums whose track path 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 file system path of a track of each album, or an error.</returns>
|
||||
Task<Result<IReadOnlyDictionary<Guid, string>>> GetFirstTrackPathsByAlbumIdsAsync(IReadOnlyCollection<Guid> albumIds, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the metadata enrichment status of all the albums of the media library identified by <paramref name="libraryId"/>,
|
||||
/// so that they are re-enriched, because the metadata provider configuration of the library changed.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose albums are reset.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Updated>> ResetMetadataStatusForLibraryAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
}
|
||||
+59
@@ -3,7 +3,11 @@ using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.Mu
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
|
||||
using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Repositories.MusicLibrary;
|
||||
@@ -19,4 +23,59 @@ public interface IArtistRepository : IRepository<ArtistEntity>,
|
||||
IGetAllLiteRepositoryAction<ArtistEntity, ArtistLiteRow>,
|
||||
IDeleteByIdRepositoryAction<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the artist of the library identified by <paramref name="libraryId"/> that has the provided <paramref name="name"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the library whose artist is retrieved.</param>
|
||||
/// <param name="name">The name of the artist to retrieve.</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="ArtistEntity"/> with the provided name, or an error.</returns>
|
||||
Task<Result<ArtistEntity?>> GetByNameAsync(Guid libraryId, string name, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of the artists of the media library identified by <paramref name="libraryId"/> whose metadata has not been enriched yet,
|
||||
/// together with their albums and tracks and the collections needed to enrich them, ordered by name, using keyset pagination.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose artists are retrieved.</param>
|
||||
/// <param name="lastName">The name of the last retrieved artist, used for keyset pagination. Pass <see langword="null"/> to get the first page.</param>
|
||||
/// <param name="pageSize">The maximum number of artists to retrieve.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a page of artists needing their metadata enriched, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<ArtistEntity>>> GetArtistsNeedingMetadataAsync(Guid libraryId, string? lastName, int pageSize, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of artists of the media library identified by <paramref name="libraryId"/> whose metadata has not been enriched yet.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose artists are counted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the number of artists needing their metadata enriched, or an error.</returns>
|
||||
Task<Result<int>> GetArtistsNeedingMetadataCountAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of artists of the media library identified by <paramref name="libraryId"/> whose artwork has not been resolved yet.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose artists are counted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the number of artists needing their artwork resolved, or an error.</returns>
|
||||
Task<Result<int>> GetArtistsNeedingArtworkCountAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of the artists of the media library identified by <paramref name="libraryId"/> whose artwork has not been resolved yet,
|
||||
/// together with their albums and tracks, ordered by name, using keyset pagination.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose artists are retrieved.</param>
|
||||
/// <param name="lastName">The name of the last retrieved artist, used for keyset pagination. Pass <see langword="null"/> to get the first page.</param>
|
||||
/// <param name="pageSize">The maximum number of artists to retrieve.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a page of artists needing their artwork resolved, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<ArtistEntity>>> GetArtistsNeedingArtworkAsync(Guid libraryId, string? lastName, int pageSize, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the metadata enrichment status of all the artists of the media library identified by <paramref name="libraryId"/>,
|
||||
/// so that they are re-enriched, because the metadata provider configuration of the library changed.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose artists are reset.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Updated>> ResetMetadataStatusForLibraryAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Application.Common.DataAccess.Repositories.MusicLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for the repository for the music metadata staged during a media library scan.
|
||||
/// </summary>
|
||||
public interface IMusicLibraryScanItemMetadataRepository : IRepository<MusicLibraryScanItemMetadataEntity>,
|
||||
IInsertRangeRepositoryAction<MusicLibraryScanItemMetadataEntity>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all the staged music metadata items of the media library scan identified by <paramref name="scanId"/>.
|
||||
/// </summary>
|
||||
/// <param name="scanId">The Id of the media library scan whose staged music metadata 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 a collection of <see cref="MusicLibraryScanItemMetadataEntity"/>, or an error.</returns>
|
||||
Task<Result<IReadOnlyList<MusicLibraryScanItemMetadataEntity>>> GetByScanIdAsync(Guid scanId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all the staged music metadata items of the media library scan identified by <paramref name="scanId"/>.
|
||||
/// </summary>
|
||||
/// <param name="scanId">The Id of the media library scan whose staged music metadata is deleted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Deleted>> DeleteByScanIdAsync(Guid scanId, CancellationToken cancellationToken);
|
||||
}
|
||||
+38
-1
@@ -20,7 +20,8 @@ public interface ITrackRepository : IRepository<TrackEntity>,
|
||||
IInsertRepositoryAction<TrackEntity>,
|
||||
IUpdateRepositoryAction<TrackEntity>,
|
||||
IApplyUpdateRepositoryAction<TrackEntity>,
|
||||
IGetByIdRepositoryAction<TrackEntity, Guid>
|
||||
IGetByIdRepositoryAction<TrackEntity, Guid>,
|
||||
IDeleteByIdRepositoryAction<Guid>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the subset of <paramref name="paths"/> that is already used by a track of the library identified by <paramref name="libraryId"/>.
|
||||
@@ -47,4 +48,40 @@ public interface ITrackRepository : IRepository<TrackEntity>,
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either a paginated result of <see cref="TrackLiteRow"/>, or an error.</returns>
|
||||
Task<Result<PaginatedResultDto<TrackLiteRow>>> GetTracksLiteByAlbumIdAsync(Guid albumId, PaginationDataDto? paginationData, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the track of the library identified by <paramref name="libraryId"/> that is stored at the provided <paramref name="path"/>.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the library whose track is retrieved.</param>
|
||||
/// <param name="path">The file system path of the track to retrieve.</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="TrackEntity"/> stored at the provided path, or an error.</returns>
|
||||
Task<Result<TrackEntity?>> GetByPathAsync(Guid libraryId, string path, 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.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose tracks are reset.</param>
|
||||
/// <param name="paths">The file system paths of the tracks whose enrichment state is reset.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Updated>> ResetEnrichmentStateForPathsAsync(Guid libraryId, IReadOnlyCollection<string> paths, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of tracks of the media library identified by <paramref name="libraryId"/> whose metadata has not been enriched yet.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose tracks are counted.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> containing either the number of tracks needing their metadata enriched, or an error.</returns>
|
||||
Task<Result<int>> GetTracksNeedingMetadataCountAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Resets the metadata enrichment status of all the tracks of the media library identified by <paramref name="libraryId"/>,
|
||||
/// so that they are re-enriched, because the metadata provider configuration of the library changed.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The Id of the media library whose tracks are reset.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="Result{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<Result<Updated>> ResetMetadataStatusForLibraryAsync(Guid libraryId, CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -60,6 +60,16 @@ public interface IUnitOfWork
|
||||
/// </summary>
|
||||
ITrackRepository TrackRepository { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the repository for the artwork of the music library items.
|
||||
/// </summary>
|
||||
IMusicArtworkRepository MusicArtworkRepository { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the repository for the music metadata staged during a media library scan.
|
||||
/// </summary>
|
||||
IMusicLibraryScanItemMetadataRepository MusicLibraryScanItemMetadataRepository { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the media contributor repository.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user