From 2d88a0d99ce64ba32d1f5ee493b16650ba5f43b019e507c7307062e1b350b4c8 Mon Sep 17 00:00:00 2001 From: copecone Date: Wed, 19 Aug 2026 07:57:14 +0900 Subject: [PATCH] Suppress Unused Warning in API Classes --- API/RenderResult.cs | 127 ++++++++++++++++++++++--------------------- API/RenderSession.cs | 2 + 2 files changed, 66 insertions(+), 63 deletions(-) diff --git a/API/RenderResult.cs b/API/RenderResult.cs index e560bf8..5f6699a 100644 --- a/API/RenderResult.cs +++ b/API/RenderResult.cs @@ -1,70 +1,71 @@ using System; +using System.Diagnostics.CodeAnalysis; -namespace ADOFAIRenderer.API +namespace ADOFAIRenderer.API; + +/// +/// Represents the result and metadata of a completed or cancelled render session. +/// +[SuppressMessage("ReSharper", "UnusedType.Global")] +public class RenderResult { /// - /// Represents the result and metadata of a completed or cancelled render session. + /// Indicates whether the rendering session completed successfully. /// - public class RenderResult + public bool Success { get; } + + /// + /// The absolute output path of the rendered video file. Empty string if rendering failed or output was not created. + /// + public string OutputPath { get; } + + /// + /// Total number of video frames sent to the encoder. + /// + public long TotalFrames { get; } + + /// + /// The calculated video duration in seconds (based on TotalFrames and FPS). + /// + public double VideoDuration { get; } + + /// + /// Total wall-clock time spent rendering. + /// + public TimeSpan RenderDuration { get; } + + /// + /// File size of the output video in bytes (0 if failed or file does not exist). + /// + public long FileSizeBytes { get; } + + /// + /// Error message or reason if rendering failed or was cancelled; null on success. + /// + public string? ErrorMessage { get; } + + public RenderResult( + bool success, + string outputPath, + long totalFrames, + double videoDuration, + TimeSpan renderDuration, + long fileSizeBytes = 0, + string? errorMessage = null) { - /// - /// Indicates whether the rendering session completed successfully. - /// - public bool Success { get; } - - /// - /// The absolute output path of the rendered video file. Empty string if rendering failed or output was not created. - /// - public string OutputPath { get; } - - /// - /// Total number of video frames sent to the encoder. - /// - public long TotalFrames { get; } - - /// - /// The calculated video duration in seconds (based on TotalFrames and FPS). - /// - public double VideoDuration { get; } - - /// - /// Total wall-clock time spent rendering. - /// - public TimeSpan RenderDuration { get; } - - /// - /// File size of the output video in bytes (0 if failed or file does not exist). - /// - public long FileSizeBytes { get; } - - /// - /// Error message or reason if rendering failed or was cancelled; null on success. - /// - public string? ErrorMessage { get; } - - public RenderResult( - bool success, - string outputPath, - long totalFrames, - double videoDuration, - TimeSpan renderDuration, - long fileSizeBytes = 0, - string? errorMessage = null) - { - Success = success; - OutputPath = outputPath; - TotalFrames = totalFrames; - VideoDuration = videoDuration; - RenderDuration = renderDuration; - FileSizeBytes = fileSizeBytes; - ErrorMessage = errorMessage; - } - - public override string ToString() - { - return Success - ? $"[RenderResult: Success, Output={OutputPath}, Frames={TotalFrames}, VideoDuration={VideoDuration:F2}s, Time={RenderDuration.TotalSeconds:F1}s, Size={FileSizeBytes / 1024.0 / 1024.0:F2}MB]" - : $"[RenderResult: Failed/Cancelled, Error={ErrorMessage ?? "Unknown"}]"; - } + Success = success; + OutputPath = outputPath; + TotalFrames = totalFrames; + VideoDuration = videoDuration; + RenderDuration = renderDuration; + FileSizeBytes = fileSizeBytes; + ErrorMessage = errorMessage; } -} + + public override string ToString() + { + return Success + ? $"[RenderResult: Success, Output={OutputPath}, Frames={TotalFrames}, VideoDuration={VideoDuration:F2}s, Time={RenderDuration.TotalSeconds:F1}s, Size={FileSizeBytes / 1024.0 / 1024.0:F2}MB]" + : $"[RenderResult: Failed/Cancelled, Error={ErrorMessage ?? "Unknown"}]"; + } +} \ No newline at end of file diff --git a/API/RenderSession.cs b/API/RenderSession.cs index c2e2271..44b419a 100644 --- a/API/RenderSession.cs +++ b/API/RenderSession.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using ADOFAIRenderer.Core; using ADOFAIRenderer.Data; @@ -9,6 +10,7 @@ namespace ADOFAIRenderer.API; /// /// Fluent builder for configuring and starting a render session. /// +[SuppressMessage("ReSharper", "UnusedType.Global")] public class RenderSession { private bool _auto = true;