Renames Model to Dto

This commit is contained in:
BinaryAlley committed 2026-08-12 09:24:18 -07:00
1 parent 76b9596a27
commit 3aa9702411
32 files changed
+179 -139

No files matched your search

@@ -3,7 +3,7 @@ using ErrorOr;
using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.Management;
using Lumina.Application.Common.DataAccess.Repositories.Common.Actions;
using Lumina.Application.Common.DataAccess.Repositories.Common.Base;
using Lumina.Application.Common.Infrastructure.Models.MediaLibraryScanJobPayloads;
using Lumina.Application.Common.Infrastructure.Models.DTO.MediaLibraryScanJobPayloads;
using System;
using System.Collections.Generic;
using System.Threading;
@@ -44,7 +44,7 @@ public interface ILibraryScanStagingResultsRepository : IRepository<LibraryScanS
/// <param name="pageSize">The maximum number of staging results to retrieve.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>An <see cref="ErrorOr{TValue}"/> containing either a page of staging results that need hashing, or an error.</returns>
Task<ErrorOr<IReadOnlyList<HashedFileSystemFile>>> GetFilesToHashPageAsync(Guid scanId, string? lastPath, int pageSize, CancellationToken cancellationToken);
Task<ErrorOr<IReadOnlyList<HashedFileSystemFileDto>>> GetFilesToHashPageAsync(Guid scanId, string? lastPath, int pageSize, CancellationToken cancellationToken);
/// <summary>
/// Updates the content hashes of the provided media library scan staging results.
@@ -53,7 +53,7 @@ public interface ILibraryScanStagingResultsRepository : IRepository<LibraryScanS
/// <param name="hashedFiles">The file system items whose content hashes are updated.</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<Updated>> UpdateFileHashesAsync(Guid scanId, IReadOnlyCollection<HashedFileSystemFile> hashedFiles, CancellationToken cancellationToken);
Task<ErrorOr<Updated>> UpdateFileHashesAsync(Guid scanId, IReadOnlyCollection<HashedFileSystemFileDto> hashedFiles, CancellationToken cancellationToken);
/// <summary>
/// Clears all the media library scan staging results of the provided media library scan from the storage medium.
@@ -2,13 +2,13 @@
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.Infrastructure.Models.Configuration;
namespace Lumina.Application.Common.Infrastructure.Models.DTO.Configuration;
/// <summary>
/// Model for deserializing media settings.
/// Data transfer object for deserializing media settings.
/// </summary>
[DebuggerDisplay("{SECTION_NAME}")]
public class MediaSettingsModel
public class MediaSettingsDto
{
public const string SECTION_NAME = "MediaSettings";
@@ -0,0 +1,19 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.Infrastructure.Models.DTO.Configuration;
/// <summary>
/// Data transfer object for deserializing plugins settings.
/// </summary>
[DebuggerDisplay("{SECTION_NAME}")]
public class PluginsSettingsDto
{
public const string SECTION_NAME = "PluginsSettings";
/// <summary>
/// Gets or sets the directory where the plugin assemblies are located.
/// </summary>
public required string Directory { get; init; }
}
@@ -1,16 +1,16 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Enums.FileSystem;
using Lumina.Domain.SharedKernel.Common.Enums.FileSystem;
using System.Collections.Generic;
using System.Diagnostics;
#endregion
namespace Lumina.Application.Common.Infrastructure.Models.FileSystem;
namespace Lumina.Application.Common.Infrastructure.Models.DTO.FileSystem;
/// <summary>
/// Generic file system node.
/// </summary>
[DebuggerDisplay("Path: {Path}")]
public class FileSystemTreeNode
public class FileSystemTreeNodeDto
{
/// <summary>
/// Gets or sets the full path of the file or directory.
@@ -30,5 +30,5 @@ public class FileSystemTreeNode
/// <summary>
/// Gets or sets the list of child nodes.
/// </summary>
public List<FileSystemTreeNode> Children { get; set; } = [];
public List<FileSystemTreeNodeDto> Children { get; set; } = [];
}
@@ -4,14 +4,14 @@ using System.Diagnostics;
using System.Runtime.InteropServices;
#endregion
namespace Lumina.Application.Common.Infrastructure.Models.MediaLibraryScanJobPayloads;
namespace Lumina.Application.Common.Infrastructure.Models.DTO.MediaLibraryScanJobPayloads;
/// <summary>
/// Represents an item for the payload of the file hashing media library scan job.
/// </summary>
[DebuggerDisplay("Path = {Path}, CurrentHash = {CurrentHash}, OldHash = {OldHash}, Ticks = {Ticks}, Size = {Size}")]
[StructLayout(LayoutKind.Sequential)]
public struct HashedFileSystemFile : IEquatable<HashedFileSystemFile>
public struct HashedFileSystemFileDto : IEquatable<HashedFileSystemFileDto>
{
/// <summary>
/// The path of the file system file.
@@ -39,7 +39,7 @@ public struct HashedFileSystemFile : IEquatable<HashedFileSystemFile>
public long Ticks { get; set; }
/// <inheritdoc/>
public readonly bool Equals(HashedFileSystemFile other)
public readonly bool Equals(HashedFileSystemFileDto other)
{
return Size == other.Size && CurrentHash == other.CurrentHash && OldHash == other.OldHash && Ticks == other.Ticks && Path == other.Path;
}
@@ -47,17 +47,17 @@ public struct HashedFileSystemFile : IEquatable<HashedFileSystemFile>
/// <inheritdoc/>
public override readonly bool Equals(object? obj)
{
return obj is HashedFileSystemFile item && Equals(item);
return obj is HashedFileSystemFileDto item && Equals(item);
}
/// <inheritdoc/>
public static bool operator ==(HashedFileSystemFile left, HashedFileSystemFile right)
public static bool operator ==(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
{
return left.Equals(right);
}
/// <inheritdoc/>
public static bool operator !=(HashedFileSystemFile left, HashedFileSystemFile right)
public static bool operator !=(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
{
return !(left == right);
}
@@ -1,5 +1,5 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.Infrastructure.Models.MediaLibraryScanJobPayloads;
using Lumina.Application.Common.Infrastructure.Models.DTO.MediaLibraryScanJobPayloads;
using System;
using System.Collections.Generic;
using System.Threading;
@@ -20,5 +20,5 @@ public interface IFileHashService
/// <param name="callback">Callback to invoke during processing of elements.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
/// <returns>A collection of the hashed files, along with their hashes.</returns>
Task<List<HashedFileSystemFile>> HashFilesAsync(IReadOnlyCollection<HashedFileSystemFile> files, Func<Task> callback, CancellationToken cancellationToken);
Task<List<HashedFileSystemFileDto>> HashFilesAsync(IReadOnlyCollection<HashedFileSystemFileDto> files, Func<Task> callback, CancellationToken cancellationToken);
}