mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Adopts Optional in the remaining mappings and domain events
This commit is contained in:
1 parent
c0302ecc50
commit
fc6b0538fe
5 files changed
+7
-7
No files matched your search
+1
-1
@@ -56,7 +56,7 @@ public static class LibraryEntityMapping
|
||||
repositoryEntity.Title,
|
||||
repositoryEntity.LibraryType,
|
||||
repositoryEntity.ContentLocations.Select(contentLocation => contentLocation.Path),
|
||||
repositoryEntity.CoverImage,
|
||||
Optional<string>.FromNullable(repositoryEntity.CoverImage),
|
||||
repositoryEntity.IsEnabled,
|
||||
repositoryEntity.IsLocked,
|
||||
repositoryEntity.CanDownloadMetadataFromWeb,
|
||||
|
||||
@@ -28,7 +28,7 @@ public static class LibraryScanMapping
|
||||
Library = null!,
|
||||
CreatedOnUtc = domainEntity.CreatedOnUtc,
|
||||
CreatedBy = Guid.Empty,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc : null,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc.Value : null,
|
||||
UpdatedBy = Guid.Empty
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public static class ScheduledJobMapping
|
||||
LastCompletedOnUtc = domainEntity.LastCompletedOnUtc.HasValue ? domainEntity.LastCompletedOnUtc.Value : null,
|
||||
CreatedOnUtc = domainEntity.CreatedOnUtc,
|
||||
CreatedBy = Guid.Empty,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc,
|
||||
UpdatedOnUtc = domainEntity.UpdatedOnUtc.HasValue ? domainEntity.UpdatedOnUtc.Value : null,
|
||||
UpdatedBy = Guid.Empty
|
||||
};
|
||||
}
|
||||
|
||||
+2
-3
@@ -2,7 +2,6 @@
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Models.Core;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
@@ -110,9 +109,9 @@ public class StreamInfo : ValueObject
|
||||
Optional<int> sampleRate,
|
||||
Optional<int> channels)
|
||||
{
|
||||
if (streamId is null)
|
||||
if (string.IsNullOrWhiteSpace(streamId))
|
||||
return Errors.FileSystemManagement.StreamIdCannotBeEmpty;
|
||||
if (codec is null)
|
||||
if (string.IsNullOrWhiteSpace(codec))
|
||||
return Errors.FileSystemManagement.CodecCannotBeEmpty;
|
||||
if (bitrate <= 0)
|
||||
return Errors.FileSystemManagement.BitrateMustBeAPositiveNumber;
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Events;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryScanAggregate.ValueObjects;
|
||||
using System;
|
||||
@@ -22,5 +23,5 @@ public record LibraryScanFailedDomainEvent(
|
||||
LibraryId LibraryId,
|
||||
MediaLibraryScanCompositeId MediaLibraryScanCompositeId,
|
||||
DateTime OccurredOnUtc,
|
||||
string? ErrorMessage = null
|
||||
Optional<string> ErrorMessage
|
||||
) : IDomainEvent;
|
||||
Reference in new issue
Block a user