Files
annotations/Web/Azaion.Web/Azaion.Repository/Entities/Media.cs
T
Oleksandr Bezdieniezhnykh 6f78b88007 add controller for video
2024-07-22 16:01:28 +03:00

23 lines
897 B
C#

using Azaion.Video.DTO;
using IOPath = System.IO.Path;
namespace Azaion.Repository.Entities;
public class Media
{
public Guid Id { get; set; }
public string Path { get; set; } = null!;
public int Resolution { get; set; }
public int Bitrate { get; set; }
public Guid? AnnotatorId { get; set; }
public MediaStatusEnum Status { get; set; }
public DateTime CreatedDate { get; set; }
private string MediaName => IOPath.GetFileNameWithoutExtension(Path);
private string OutDir => Directory.CreateDirectory(IOPath.Combine(Constants.MEDIA_HLS_FOLDER, MediaName)).FullName;
public string M3U8File => IOPath.Combine(OutDir, $"{MediaName}.{Constants.M3_U8_EXT}");
public string SegmentFile => IOPath.Combine(OutDir, $"{MediaName}%03d.{Constants.TS_EXT}");
}