Adds media library scan progress tracking

This commit is contained in:
BinaryAlley committed 2025-02-18 17:24:39 +02:00
1 parent e8dbf9456c
commit 27fa8e2e4f
87 files changed
+2078 -421

No files matched your search

@@ -0,0 +1,17 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Requests.MediaLibrary.Management;
/// <summary>
/// Represents a request to report the progress of a media library scan.
/// </summary>
/// <param name="LibraryId">The Id of the media library whose scan progress is requested. Required.</param>
/// <param name="ScanId">The Id of the media library scan whose progress is requested. Required.</param>
[DebuggerDisplay("LibraryId: {LibraryId}, ScanId: {ScanId}")]
public record GetLibraryScanProgressRequest(
Guid LibraryId,
Guid ScanId
);
@@ -0,0 +1,20 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.MediaLibrary.Management;
/// <summary>
/// Represents a media library scan job progress response.
/// </summary>
/// <param name="CompletedItems">The number of processed scan job items.</param>
/// <param name="TotalItems">The total number of scan job items.</param>
/// <param name="CurrentOperation">The current processing operation in the scan job.</param>
/// <param name="ProgressPercentage">The ratio between the number of processed items and the total number of items to process, as percentage.</param>
[DebuggerDisplay("CompletedItems: {CompletedItems} TotalItems: {TotalItems}")]
public record MediaLibraryScanJobProgressResponse(
int CompletedItems,
int TotalItems,
string CurrentOperation,
decimal ProgressPercentage
);
@@ -0,0 +1,24 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Domain.Common.Enums.MediaLibrary;
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Contracts.Responses.MediaLibrary.Management;
/// <summary>
/// Represents a media library scan progress response.
/// </summary>
/// <param name="TotalJobs">The total number of jobs to be processed by the scan.</param>
/// <param name="CompletedJobs">The number of jobs that have been processed.</param>
/// <param name="CurrentJobProgress">The progress of the currently processing job.</param>
/// <param name="Status">The status of the scan.</param>
/// <param name="OverallProgressPercentage">The ratio between the number of processed jobs and the total number of jobs to process, as percentage.</param>
[DebuggerDisplay("TotalJobs: {TotalJobs} CompletedJobs: {CompletedJobs}")]
public record MediaLibraryScanProgressResponse(
int TotalJobs,
int CompletedJobs,
MediaLibraryScanJobProgressResponse? CurrentJobProgress,
LibraryScanJobStatus Status,
decimal OverallProgressPercentage
);
@@ -11,7 +11,7 @@ namespace Lumina.Contracts.Responses.MediaLibrary.Management;
/// <param name="ScanId">The unique identifier of the media library scan.</param>
/// <param name="LibraryId">The unique identifier of the scanned media library.</param>
[DebuggerDisplay("ScanId: {ScanId} LibraryId: {LibraryId}")]
public record ScanLibraryResponse(
public record MediaLibraryScanResponse(
Guid ScanId,
Guid LibraryId
);