Encoding added Requested Encoding to the request, made request async, some refactoring

This commit is contained in:
Samuele Lorefice
2025-12-15 19:00:31 +01:00
parent db20f5d54d
commit db6873c93c
6 changed files with 108 additions and 44 deletions

View File

@@ -1,9 +1,31 @@
namespace Encoder;
public record EncodingJob(Guid Id, string OrigFilePath) {
public enum JobStatus {
Pending,
InProgress,
Completed,
Failed
}
public enum EncoderType {
AV1,
HEVC
}
public record EncodingJob {
public Guid Id { get; init; }
public JobStatus Status { get; set; } = JobStatus.Pending;
public DateTime CreatedAt { get; init; } = DateTime.Now;
public DateTime? CompletedAt { get; set; } = null;
public string FilePath { get; init; }
public EncoderType RequestedEncoding { get; init; }
public string EncodedFilePath { get; set; } = string.Empty;
public float Progress { get; set; } = 0.0f;
public EncodingJob(Guid id, string filePath, EncoderType requestedEncoding) {
Id = id;
FilePath = filePath;
RequestedEncoding = requestedEncoding;
}
}