mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:46:30 +00:00
23 lines
897 B
C#
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}");
|
|
}
|