Adds real time media libraries scan progress update via SignalR

This commit is contained in:
BinaryAlley committed 2025-02-22 17:45:09 +02:00
1 parent d70b2dcaa0
commit e0d61802df
71 files changed
+1292 -131

No files matched your search

@@ -0,0 +1,32 @@
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Libraries;
/// <summary>
/// Represents a media library scan job progress model.
/// </summary>
[DebuggerDisplay("CompletedItems: {CompletedItems}; TotalItems: {TotalItems}")]
public class LibraryScanJobProgressModel
{
/// <summary>
/// Gets or sets the number of completed items of the media library scan job.
/// </summary>
public int CompletedItems { get; set; }
/// <summary>
/// Gets or sets the total number of items of the media library scan job.
/// </summary>
public int TotalItems { get; set; }
/// <summary>
/// Gets or sets the current operation being performed by the media library scan job.
/// </summary>
public string? CurrentOperation { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of items, as a percentage.
/// </summary>
public decimal ProgressPercentage { get; set; }
}
@@ -0,0 +1,53 @@
#region ========================================================================= USING =====================================================================================
using System;
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.Libraries;
/// <summary>
/// Represents a media library scan progress model.
/// </summary>
[DebuggerDisplay("ScanId: {ScanId}; UserId: {UserId}; LibraryId: {LibraryId}")]
public class LibraryScanProgressModel
{
/// <summary>
/// Gets or sets the unique identifier of the media library scan.
/// </summary>
public Guid ScanId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the user initiating this media library scan.
/// </summary>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the unique identifier of the media library that is scanned.
/// </summary>
public Guid LibraryId { get; set; }
/// <summary>
/// Gets or sets the number of completed jobs of the media library scan job.
/// </summary>
public int CompletedJobs { get; set; }
/// <summary>
/// Gets or sets the total number of jobs of the media library scan job.
/// </summary>
public int TotalJobs { get; set; }
/// <summary>
/// Gets or sets the optional current job progress of the media library scan.
/// </summary>
public LibraryScanJobProgressModel? CurrentJobProgress { get; set; }
/// <summary>
/// Gets or sets the status of the media library scan.
/// </summary>
public string? Status { get; set; }
/// <summary>
/// Gets or sets the ratio between the total number and the completed number of jobs, as a percentage.
/// </summary>
public decimal OverallProgressPercentage { get; set; }
}