mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
Adds deletion and restore for music library items.
This commit is contained in:
1 parent
98515dc5e8
commit
f9ad8b2fc5
224 files changed
+22384
-1360
No files matched your search
+19
@@ -228,6 +228,25 @@ public static class AlbumEntityMapping
|
||||
artwork ?? []);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntity"/> to <see cref="DeletedAlbumResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="repositoryEntity">The repository entity to be converted.</param>
|
||||
/// <param name="deletedOnUtc">The date and time when the album was deleted.</param>
|
||||
/// <param name="coverPath">The optional path of the image representing the album.</param>
|
||||
/// <returns>The converted response entity.</returns>
|
||||
public static DeletedAlbumResponse ToResponse(this AlbumEntity repositoryEntity, DateTime deletedOnUtc, string? coverPath = null)
|
||||
{
|
||||
return new DeletedAlbumResponse(
|
||||
repositoryEntity.Id,
|
||||
repositoryEntity.LibraryId,
|
||||
repositoryEntity.ArtistId,
|
||||
repositoryEntity.Artist?.Name ?? string.Empty,
|
||||
repositoryEntity.Title,
|
||||
deletedOnUtc,
|
||||
coverPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntities"/> to a collection of <see cref="AlbumResponse"/>.
|
||||
/// </summary>
|
||||
|
||||
+17
@@ -183,6 +183,23 @@ public static class ArtistEntityMapping
|
||||
coverPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntity"/> to <see cref="DeletedArtistResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="repositoryEntity">The repository entity to be converted.</param>
|
||||
/// <param name="deletedOnUtc">The date and time when the artist was deleted.</param>
|
||||
/// <param name="coverPath">The optional path of the image representing the artist.</param>
|
||||
/// <returns>The converted response entity.</returns>
|
||||
public static DeletedArtistResponse ToResponse(this ArtistEntity repositoryEntity, DateTime deletedOnUtc, string? coverPath = null)
|
||||
{
|
||||
return new DeletedArtistResponse(
|
||||
repositoryEntity.Id,
|
||||
repositoryEntity.LibraryId,
|
||||
repositoryEntity.Name,
|
||||
deletedOnUtc,
|
||||
coverPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntities"/> to a collection of <see cref="ArtistResponse"/>.
|
||||
/// </summary>
|
||||
|
||||
+20
@@ -293,6 +293,26 @@ public static class TrackEntityMapping
|
||||
repositoryEntity.Container);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntity"/> to <see cref="DeletedTrackResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="repositoryEntity">The repository entity to be converted.</param>
|
||||
/// <param name="deletedOnUtc">The date and time when the track was deleted.</param>
|
||||
/// <returns>The converted response entity.</returns>
|
||||
public static DeletedTrackResponse ToResponse(this TrackEntity repositoryEntity, DateTime deletedOnUtc)
|
||||
{
|
||||
return new DeletedTrackResponse(
|
||||
repositoryEntity.Id,
|
||||
repositoryEntity.LibraryId,
|
||||
repositoryEntity.Album?.ArtistId ?? Guid.Empty,
|
||||
repositoryEntity.Album?.Artist?.Name ?? string.Empty,
|
||||
repositoryEntity.AlbumId,
|
||||
repositoryEntity.Album?.Title ?? string.Empty,
|
||||
repositoryEntity.Title,
|
||||
repositoryEntity.Path,
|
||||
deletedOnUtc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts <paramref name="repositoryEntities"/> to a collection of <see cref="TrackResponse"/>.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user