2024-07-30 16:19:51 +02:00
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WatchIt.Common.Model.Media;
|
|
|
|
|
|
|
2024-09-11 15:59:13 +02:00
|
|
|
|
public abstract class MediaPoster
|
2024-07-30 16:19:51 +02:00
|
|
|
|
{
|
2024-09-22 23:11:21 +02:00
|
|
|
|
#region PROPERTIES
|
|
|
|
|
|
|
2024-07-30 16:19:51 +02:00
|
|
|
|
[JsonPropertyName("image")]
|
|
|
|
|
|
public required byte[] Image { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("mime_type")]
|
|
|
|
|
|
public required string MimeType { get; set; }
|
2024-09-22 23:11:21 +02:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region PUBLIC METHODS
|
|
|
|
|
|
|
|
|
|
|
|
public override string ToString() => $"data:{MimeType};base64,{Convert.ToBase64String(Image)}";
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-07-30 16:19:51 +02:00
|
|
|
|
}
|