mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12:11:10 +00:00
Adds media library cover image
This commit is contained in:
1 parent
89debaeaad
commit
666a739b1d
43 files changed
+1170
-94
No files matched your search
+3
-4
@@ -17,15 +17,14 @@ public static class AddMediaLibraryRequestMapping
|
||||
/// Converts <paramref name="request"/> to <see cref="AddLibraryCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="userId">The Id of the user owning the media library.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static AddLibraryCommand ToCommand(this AddLibraryRequest request, Guid userId)
|
||||
public static AddLibraryCommand ToCommand(this AddLibraryRequest request)
|
||||
{
|
||||
return new AddLibraryCommand(
|
||||
userId,
|
||||
request.Title,
|
||||
request.LibraryType,
|
||||
request.ContentLocations
|
||||
request.ContentLocations,
|
||||
request.CoverImage
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public static class LibraryEntityMapping
|
||||
repositoryEntity.Title,
|
||||
repositoryEntity.LibraryType,
|
||||
repositoryEntity.ContentLocations.Select(location => location.Path).ToList(),
|
||||
repositoryEntity.CoverImage,
|
||||
repositoryEntity.CreatedOnUtc,
|
||||
repositoryEntity.UpdatedOnUtc
|
||||
);
|
||||
|
||||
@@ -26,6 +26,7 @@ public static class LibraryMapping
|
||||
LibraryType = domainEntity.LibraryType,
|
||||
UserId = domainEntity.UserId.Value,
|
||||
ContentLocations = domainEntity.ContentLocations.Select(path => new LibraryContentLocationEntity() { Path = path.Path }).ToList(),
|
||||
CoverImage = domainEntity.CoverImage,
|
||||
CreatedOnUtc = domainEntity.CreatedOnUtc,
|
||||
CreatedBy = Guid.Empty,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc : null,
|
||||
|
||||
+3
-4
@@ -15,17 +15,16 @@ public static class UpdateLibraryRequestMapping
|
||||
/// Converts <paramref name="request"/> to <see cref="UpdateLibraryCommand"/>.
|
||||
/// </summary>
|
||||
/// <param name="request">The request to be converted.</param>
|
||||
/// <param name="userId">The Id of the user making the request to update the media library.</param>
|
||||
/// <returns>The converted command.</returns>
|
||||
public static UpdateLibraryCommand ToCommand(this UpdateLibraryRequest request, Guid userId)
|
||||
public static UpdateLibraryCommand ToCommand(this UpdateLibraryRequest request)
|
||||
{
|
||||
return new UpdateLibraryCommand(
|
||||
request.Id,
|
||||
request.UserId,
|
||||
userId,
|
||||
request.Title,
|
||||
request.LibraryType,
|
||||
request.ContentLocations
|
||||
request.ContentLocations,
|
||||
request.CoverImage
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user