mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Fixes typos and replaces LINQ conversions with collection expressions
This commit is contained in:
1 parent
adadec7f3b
commit
74e9030a18
75 files changed
+113
-113
No files matched your search
+1
-1
@@ -102,7 +102,7 @@ public class AudioMetadata : BaseMetadata
|
||||
/// <param name="genres">The genres of the audio.</param>
|
||||
/// <param name="tags">The tags associated with the audio.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="AudioMetadata"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="AudioMetadata"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<AudioMetadata> Create(
|
||||
string title,
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ public sealed class Directory : FileSystemItem
|
||||
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
|
||||
/// <param name="status">The status of the file system item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<Directory> Create(
|
||||
string path,
|
||||
@@ -87,7 +87,7 @@ public sealed class Directory : FileSystemItem
|
||||
/// <param name="dateModified">The date and time the directory was last modified. Can be optional if unknown.</param>
|
||||
/// <param name="status">The status of the file system item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Directory"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Directory"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<Directory> Create(
|
||||
FileSystemPathId id,
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ public sealed class File : FileSystemItem
|
||||
/// <param name="size">The size of the file in bytes.</param>
|
||||
/// <param name="status">The status of the file system item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<File> Create(
|
||||
string path,
|
||||
@@ -92,7 +92,7 @@ public sealed class File : FileSystemItem
|
||||
/// <param name="size">The size of the file in bytes.</param>
|
||||
/// <param name="status">The status of the file system item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="File"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="File"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<File> Create(
|
||||
FileSystemPathId id,
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public sealed class UnixRootItem : FileSystemItem
|
||||
/// </summary>
|
||||
/// <param name="status">The status of the file system root item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="UnixRootItem"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="UnixRootItem"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<UnixRootItem> Create(FileSystemItemStatus status = FileSystemItemStatus.Accessible)
|
||||
{
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ public sealed class WindowsRootItem : FileSystemItem
|
||||
/// <param name="name">The name of the file system root item.</param>
|
||||
/// <param name="status">The status of the file system root item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<WindowsRootItem> Create(
|
||||
string path,
|
||||
@@ -65,7 +65,7 @@ public sealed class WindowsRootItem : FileSystemItem
|
||||
/// <param name="name">The name of the file system root item.</param>
|
||||
/// <param name="status">The status of the file system root item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WindowsRootItem"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WindowsRootItem"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<WindowsRootItem> Create(
|
||||
FileSystemPathId id,
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public sealed class FileSystemPathId : ValueObject
|
||||
/// </summary>
|
||||
/// <param name="path">The path of the file system item.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="FileSystemPathId"/> or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="FileSystemPathId"/> or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<FileSystemPathId> Create(string path)
|
||||
{
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class PathSegment : ValueObject
|
||||
/// <param name="isDirectory">Value indicating if the current path segment is a file system directory or not.</param>
|
||||
/// <param name="isDrive">Value indicating if the current path segment is a file system drive or not.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="PathSegment"/> or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="PathSegment"/> or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<PathSegment> Create(string name, bool isDirectory, bool isDrive)
|
||||
{
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class StreamInfo : ValueObject
|
||||
/// <param name="sampleRate">The sample rate of the stream (for audio).</param>
|
||||
/// <param name="channels">The number of channels (for audio).</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="StreamInfo"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="StreamInfo"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<StreamInfo> Create(
|
||||
string streamId,
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ public class LibraryScan : AggregateRoot<ScanId>
|
||||
/// <param name="userId">The object representing the unique identifier of the user initiating the media library scan.</param>
|
||||
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<LibraryScan> Create(LibraryId libraryId, UserId userId, List<LibraryScan> pastScans)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class LibraryScan : AggregateRoot<ScanId>
|
||||
/// <param name="status">The status of the media library scan.</param>
|
||||
/// <param name="pastScans">The list of past media library scans the library identified by <paramref name="libraryId"/> had.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="LibraryScan"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="LibraryScan"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<LibraryScan> Create(ScanId id, LibraryId libraryId, UserId userId, LibraryScanJobStatus status, List<LibraryScan> pastScans)
|
||||
{
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@ public interface IMediaLibraryScanningService
|
||||
/// </summary>
|
||||
/// <param name="scan">The media library scan to start.</param>
|
||||
/// <param name="libraryType">The type of the media library to be scanned.</param>
|
||||
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken);
|
||||
Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Cancels <paramref name="scan"/>.
|
||||
|
||||
+4
-5
@@ -12,7 +12,6 @@ using Lumina.Domain.Core.BoundedContexts.UserManagementBoundedContext.UserAggreg
|
||||
using Mediator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
@@ -57,10 +56,10 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
|
||||
/// </summary>
|
||||
/// <param name="scan">The media library scan to start.</param>
|
||||
/// <param name="libraryType">The type of the media library to be scanned.</param>
|
||||
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>An <see cref="ErrorOr{TValue}"/> representing either a successful operation, or an error.</returns>
|
||||
public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMedatadaFromWeb, CancellationToken cancellationToken)
|
||||
public async Task<ErrorOr<Success>> StartScanAsync(LibraryScan scan, LibraryType libraryType, bool downloadMetadataFromWeb, CancellationToken cancellationToken)
|
||||
{
|
||||
// mark the scan itself as started
|
||||
ErrorOr<Success> startScanResult = scan.StartScan();
|
||||
@@ -76,14 +75,14 @@ internal class MediaLibraryScanningService : IMediaLibraryScanningService
|
||||
try
|
||||
{
|
||||
// link the user's cancellation token with the scan's token
|
||||
CancellationTokenSource linkedSource = CancellationTokenSource
|
||||
using CancellationTokenSource linkedSource = CancellationTokenSource
|
||||
.CreateLinkedTokenSource(cancellationToken, _mediaLibrariesScanCancellationTracker.GetTokenForScan(MediaLibraryScanCompositeId.Create(scan.Id, scan.UserId)));
|
||||
|
||||
// get a media library scanner for the provided media library type
|
||||
IMediaTypeScanner scanner = _mediaLibraryScannerFactory.CreateLibraryScanner(libraryType);
|
||||
// get the list of scan jobs for the retrieved scanner. It is impotant to enumerate them here, because deferred execuction would destroy any graph relationships
|
||||
// and properties we might set before putting the jobs on the in-memory queue.
|
||||
List<IMediaLibraryScanJob> jobs = scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMedatadaFromWeb).ToList();
|
||||
List<IMediaLibraryScanJob> jobs = [.. scanner.CreateScanJobsForLibrary(scan.LibraryId, downloadMetadataFromWeb)];
|
||||
|
||||
// count total jobs in the chain by traversing the job graph
|
||||
int totalJobs = CountTotalJobs(jobs);
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ public interface IMediaTypeScanner
|
||||
/// Creates the media library scan jobs for the provided media library.
|
||||
/// </summary>
|
||||
/// <param name="libraryId">The unique identifier of the media library for which to create the media library scan jobs.</param>
|
||||
/// <param name="downloadMedatadaFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <param name="downloadMetadataFromWeb">Whether the library permits downloading data from the web, or not.</param>
|
||||
/// <returns>A collection of media library scan jobs.</returns>
|
||||
IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMedatadaFromWeb);
|
||||
IEnumerable<IMediaLibraryScanJob> CreateScanJobsForLibrary(LibraryId libraryId, bool downloadMetadataFromWeb);
|
||||
}
|
||||
+1
-1
@@ -54,7 +54,7 @@ public sealed class MediaLibraryScanJobProgress : ValueObject
|
||||
/// <param name="totalItems">The total number of items of the media library scan job.</param>
|
||||
/// <param name="currentOperation">The current operation being performed by the media library scan job.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanJobProgress"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanJobProgress"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<MediaLibraryScanJobProgress> Create(int completedItems, int totalItems, string currentOperation)
|
||||
{
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public sealed class MediaLibraryScanProgress : ValueObject
|
||||
/// <param name="status">The status of the media library scan.</param>
|
||||
/// <param name="currentJobProgress">The optional current job progress of the media library scan.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="MediaLibraryScanProgress"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="MediaLibraryScanProgress"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<MediaLibraryScanProgress> Create(
|
||||
ScanId scanId,
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ public sealed class User : AggregateRoot<UserId>
|
||||
/// </summary>
|
||||
/// <param name="username">The username of the user.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<User> Create(string username)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public sealed class User : AggregateRoot<UserId>
|
||||
/// <param name="id">The object representing the unique identifier of the user.</param>
|
||||
/// <param name="username">The username of the user.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="User"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="User"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<User> Create(UserId id, string username)
|
||||
{
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public class VideoMetadata : BaseMetadata
|
||||
/// <param name="genres">The genres of the video.</param>
|
||||
/// <param name="tags">The tags associated with the video.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="VideoMetadata"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="VideoMetadata"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<VideoMetadata> Create(
|
||||
string title,
|
||||
|
||||
+2
-2
@@ -196,7 +196,7 @@ public sealed class Book : AggregateRoot<BookId>
|
||||
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
|
||||
/// <param name="ratings">The list of ratings for the book.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<Book> Create(
|
||||
WrittenContentMetadata metadata,
|
||||
@@ -266,7 +266,7 @@ public sealed class Book : AggregateRoot<BookId>
|
||||
/// <param name="contributors">The list of objects representing the unique identifiers of the media contributors of the book.</param>
|
||||
/// <param name="ratings">The list of ratings for the book.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Book"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Book"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<Book> Create(
|
||||
BookId id,
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
|
||||
/// <param name="isComplete">The current status of the book series.</param>
|
||||
/// <param name="books">The books of the book series.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<BookSeries> Create(
|
||||
BookSeriesId id,
|
||||
@@ -80,7 +80,7 @@ public sealed class BookSeries : Entity<BookSeriesId>
|
||||
/// <param name="isComplete">The current status of the book series.</param>
|
||||
/// <param name="books">The books of the book series.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="BookSeries"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="BookSeries"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<BookSeries> Create(
|
||||
WrittenContentMetadata metadata,
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class BookRating : Rating
|
||||
/// <param name="source">The optional source of the rating.</param>
|
||||
/// <param name="voteCount">The optional number of votes or reviews.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="Rating"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="Rating"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<BookRating> Create(decimal value, decimal maxValue, Optional<BookRatingSource> source, Optional<int> voteCount)
|
||||
{
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class WrittenContentMetadata : BaseMetadata
|
||||
/// <param name="publisher">The publisher of the written content, if applicable.</param>
|
||||
/// <param name="pageCount">The number of pages in the written content, if applicable.</param>
|
||||
/// <returns>
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfuly created <see cref="WrittenContentMetadata"/>, or an error message.
|
||||
/// An <see cref="ErrorOr{TValue}"/> containing either a successfully created <see cref="WrittenContentMetadata"/>, or an error message.
|
||||
/// </returns>
|
||||
public static ErrorOr<WrittenContentMetadata> Create(
|
||||
string title,
|
||||
|
||||
Reference in new issue
Block a user