2026-10-01 12:22:08 +02:00
using MongoDB.Entities ;
namespace PrivaPub.Models.Media
{
public class MediaAttachment : Entity
{
public string OwnerAvatarId { get ; set ; }
public string PostId { get ; set ; }
public string Kind { get ; set ; }
public string ContentType { get ; set ; }
public string FilePath { get ; set ; }
public string PreviewPath { get ; set ; }
public long Size { get ; set ; }
public string Description { get ; set ; }
public string Blurhash { get ; set ; }
public int? Width { get ; set ; }
public int? Height { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "Null when no focal point was set, and the image is centred.")]
2026-10-01 12:22:08 +02:00
public float [] Focus { get ; set ; }
2026-10-07 10:48:56 +02:00
public double? DurationSeconds { get ; set ; }
// audio and video sent to /api/v2/media are processed by a job: "pending" until then, "failed" (with why) if it can't be
public string ProcessingState { get ; set ; }
public string ProcessingError { get ; set ; }
2026-10-01 12:22:08 +02:00
public DateTime CreatedAt { get ; set ; } = DateTime . UtcNow ;
public DateTime ? AttachedAt { get ; set ; }
2026-10-05 02:55:17 +02:00
public string ScheduledStatusId { get ; set ; } //kept for a scheduled post until it is published or dropped
2026-10-07 10:31:14 +02:00
public string ProfileOfAvatarId { get ; set ; } //a persona's avatar or header (Kind "avatar" or "header"), never a post's
2026-10-17 04:02:47 +02:00
public string ServerUse { get ; set ; } //the server's own picture ("thumbnail", ServerSettings.ThumbnailMediaId): held while it is set
2026-10-07 10:31:14 +02:00
// set once nothing holds it any more (its post deleted, edited out, replaced, its root removed, never posted): its
// files move out of what /media/files serves at once, and the janitor deletes them after a grace
public DateTime ? TrashedAt { get ; set ; }
public string TrashReason { get ; set ; }
2026-10-01 12:22:08 +02:00
}
public class MediaSecret : Entity
{
public string Key { get ; set ; }
}
}