Enhance user and media management with sorting and statistics: add sorting options to user and media listing endpoints, implement media statistics retrieval, and update frontend components for sorting and displaying media processing times. Refactor related query handlers and API types to support new features.
This commit is contained in:
@@ -55,6 +55,31 @@ public class MediaAssetTests
|
||||
Assert.Null(asset.ErrorMessage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MarkProcessing_RecordsStart_AndMarkReady_ComputesProcessingDuration()
|
||||
{
|
||||
var asset = MediaAsset.Register("a.mp4", ".mp4", MediaSource.Upload);
|
||||
|
||||
asset.MarkProcessing();
|
||||
Assert.NotNull(asset.ProcessingStartedAt);
|
||||
Assert.Null(asset.ProcessingDuration);
|
||||
|
||||
asset.MarkReady(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc");
|
||||
|
||||
Assert.NotNull(asset.ProcessingDuration);
|
||||
Assert.True(asset.ProcessingDuration >= TimeSpan.Zero);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MarkReady_WithoutProcessingStart_LeavesDurationNull()
|
||||
{
|
||||
var asset = MediaAsset.Register("a.mp4", ".mp4", MediaSource.Upload);
|
||||
|
||||
asset.MarkReady(TimeSpan.FromSeconds(120), 2, 60, 1920, 1080, "h264", "aac", "assets/abc");
|
||||
|
||||
Assert.Null(asset.ProcessingDuration);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MarkFailed_StoresError()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user