video thumbnail generation
still not perfect actually cache thumbnail simplify media id
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user