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

@@ -16,6 +16,16 @@ public class AobaIndexCreationService(IMongoDatabase db): BackgroundService
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
BsonSerializer.RegisterSerializer(new EnumSerializer<ThumbnailSize>(BsonType.String));
var mediaId = Builders<Media>.IndexKeys.Ascending(m => m.MediaId);
var mediaIdModel = new CreateIndexModel<Media>(mediaId, new CreateIndexOptions
{
Name = "Media",
Unique = true,
Background = true
});
var textKeys = Builders<Media>.IndexKeys
.Text(m => m.Filename)
.Text(m => m.Ext)
@@ -27,6 +37,7 @@ public class AobaIndexCreationService(IMongoDatabase db): BackgroundService
Background = true
});
await _media.EnsureIndexAsync(mediaIdModel);
await _media.EnsureIndexAsync(textModel);
}
}