video thumbnail generation

still not perfect

actually cache thumbnail
simplify media id
This commit is contained in:
2025-07-04 16:00:22 -04:00
parent 201de5796e
commit ccbea45809
9 changed files with 102 additions and 70 deletions

View File

@@ -7,7 +7,7 @@ namespace AobaCore.Models;
public class Media
{
[BsonId]
public ObjectId Id { get; set; }
public ObjectId LegacyId { get; set; }
public ObjectId MediaId { get; set; }
public string Filename { get; set; }
public MediaType MediaType { get; set; }
@@ -16,6 +16,7 @@ public class Media
public ObjectId Owner { get; set; }
public DateTime UploadDate { get; set; }
public string[] Tags { get; set; } = [];
public Dictionary<ThumbnailSize, ObjectId> Thumbnails { get; set; } = [];
public static readonly Dictionary<string, MediaType> KnownTypes = new()
@@ -65,7 +66,7 @@ public class Media
Filename = filename;
MediaId = fileId;
Owner = owner;
Id = ObjectId.GenerateNewId();
LegacyId = ObjectId.GenerateNewId();
UploadDate = DateTime.UtcNow;
Tags = DeriveTags(filename);
}