[ADD] New entities for library db
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Migrations\" />
|
<Folder Include="Migrations\" />
|
||||||
<Folder Include="Models\LibraryContext\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
7
Manager.Data/Models/DateTimeBase.cs
Normal file
7
Manager.Data/Models/DateTimeBase.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Manager.Data.Models;
|
||||||
|
|
||||||
|
public abstract class DateTimeBase
|
||||||
|
{
|
||||||
|
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
|
||||||
|
public DateTime LastModifiedUtc { get; set; } = DateTime.UtcNow;
|
||||||
|
}
|
9
Manager.Data/Models/LibraryContext/CaptionEntity.cs
Normal file
9
Manager.Data/Models/LibraryContext/CaptionEntity.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class CaptionEntity
|
||||||
|
{
|
||||||
|
public required string MediaId { get; set; }
|
||||||
|
public required string Name { get; set; }
|
||||||
|
public required string CaptionPath { get; set; }
|
||||||
|
public string? LanguageCode { get; set; }
|
||||||
|
}
|
15
Manager.Data/Models/LibraryContext/ChannelEntity.cs
Normal file
15
Manager.Data/Models/LibraryContext/ChannelEntity.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class ChannelEntity
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
public string? Name { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public DateTime JoinedDate { get; set; }
|
||||||
|
public long Subscribers { get; set; }
|
||||||
|
public long TotalVideos { get; set; }
|
||||||
|
public long TotalViews { get; set; }
|
||||||
|
|
||||||
|
public DateTime AddedDate { get; set; }
|
||||||
|
public DateTime ModifiedDate { get; set; }
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class ClientAccountEntity : DateTimeBase
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
public string Name { get; set; } = "";
|
||||||
|
public List<PlaylistEntity> Playlists { get; set; } = [];
|
||||||
|
public List<HttpCookieEntity> HttpCookies { get; set; } = [];
|
||||||
|
}
|
15
Manager.Data/Models/LibraryContext/HttpCookieEntity.cs
Normal file
15
Manager.Data/Models/LibraryContext/HttpCookieEntity.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class HttpCookieEntity : DateTimeBase
|
||||||
|
{
|
||||||
|
public required string Name { get; set; }
|
||||||
|
public string? Value { get; set; }
|
||||||
|
public string? Domain { get; set; }
|
||||||
|
public string? Path { get; set; }
|
||||||
|
public DateTimeOffset? ExpiresUtc { get; set; }
|
||||||
|
public bool Secure { get; set; }
|
||||||
|
public bool HttpOnly { get; set; }
|
||||||
|
public string? SameSite { get; set; }
|
||||||
|
|
||||||
|
public required string ClientId { get; set; }
|
||||||
|
}
|
33
Manager.Data/Models/LibraryContext/MediaEntity.cs
Normal file
33
Manager.Data/Models/LibraryContext/MediaEntity.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class MediaEntity : DateTimeBase
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
public string? Title { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public DateTime UploadDateUtc { get; set; }
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
public List<MediaFormatEntity> Formats { get; set; } = [];
|
||||||
|
public List<CaptionEntity> Captions { get; set; } = [];
|
||||||
|
|
||||||
|
public MediaState State { get; set; } = MediaState.Online;
|
||||||
|
public bool IsDownloaded { get; set; }
|
||||||
|
public MediaProcessState ProcessState { get; set; } = MediaProcessState.ToDownload;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MediaState
|
||||||
|
{
|
||||||
|
Online,
|
||||||
|
Offline,
|
||||||
|
Limited,
|
||||||
|
Removed
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MediaProcessState
|
||||||
|
{
|
||||||
|
ToDownload,
|
||||||
|
Downloaded,
|
||||||
|
ToRemove,
|
||||||
|
Removed,
|
||||||
|
Failed
|
||||||
|
}
|
36
Manager.Data/Models/LibraryContext/MediaFormatEntity.cs
Normal file
36
Manager.Data/Models/LibraryContext/MediaFormatEntity.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class MediaFormatEntity
|
||||||
|
{
|
||||||
|
public required string MediaId { get; set; }
|
||||||
|
public required string MediaPath { get; set; }
|
||||||
|
public VideoQuality VideoQuality { get; set; } = VideoQuality.None;
|
||||||
|
public bool IsAdaptive { get; set; }
|
||||||
|
public string? MimeType { get; set; }
|
||||||
|
public long Bitrate { get; set; }
|
||||||
|
public long AverageBitrate { get; set; }
|
||||||
|
public long LastModifiedUnixEpoch { get; set; }
|
||||||
|
public long ContentLengthBytes { get; set; }
|
||||||
|
public long ApproxDurationMs { get; set; }
|
||||||
|
public int Width { get; set; }
|
||||||
|
public int Height { get; set; }
|
||||||
|
public double Framerate { get; set; }
|
||||||
|
public string? QualityLabel { get; set; }
|
||||||
|
public int AudioChannels { get; set; }
|
||||||
|
public string? AudioSampleRate { get; set; }
|
||||||
|
public double LoudnessDb { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum VideoQuality
|
||||||
|
{
|
||||||
|
P4320 = 4320,
|
||||||
|
P2160 = 2160,
|
||||||
|
P1440 = 1440,
|
||||||
|
P1080 = 1080,
|
||||||
|
P720 = 720,
|
||||||
|
P480 = 480,
|
||||||
|
P360 = 360,
|
||||||
|
P240 = 240,
|
||||||
|
P144 = 144,
|
||||||
|
None = 0
|
||||||
|
}
|
9
Manager.Data/Models/LibraryContext/PlaylistEntity.cs
Normal file
9
Manager.Data/Models/LibraryContext/PlaylistEntity.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Manager.Data.Models.LibraryContext;
|
||||||
|
|
||||||
|
public class PlaylistEntity : DateTimeBase
|
||||||
|
{
|
||||||
|
public required string Id { get; set; }
|
||||||
|
public required string Name { get; set; }
|
||||||
|
public string? Description { get; set; }
|
||||||
|
public required string ChannelId { get; set; }
|
||||||
|
}
|
Reference in New Issue
Block a user