testing using ffmpeg to generate thumbnails for avif
This commit is contained in:
@@ -121,6 +121,9 @@ builder.Services.AddAuthentication(options =>
|
||||
|
||||
|
||||
builder.Services.AddAoba();
|
||||
#if DEBUG
|
||||
builder.Services.AddHostedService<DebugService>();
|
||||
#endif
|
||||
builder.Services.Configure<FormOptions>(opt =>
|
||||
{
|
||||
opt.ValueLengthLimit = int.MaxValue;
|
||||
|
||||
19
AobaServer/Services/DebugService.cs
Normal file
19
AobaServer/Services/DebugService.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
using AobaCore.Services;
|
||||
|
||||
namespace AobaServer.Services;
|
||||
|
||||
public class DebugService(AobaService aobaService, ThumbnailService thumbnailService) : BackgroundService
|
||||
{
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
var mediaItems = await aobaService.FindMediaWithExtAsync(".avif", stoppingToken);
|
||||
foreach (var item in mediaItems)
|
||||
{
|
||||
foreach (var size in item.Thumbnails.Keys)
|
||||
{
|
||||
await thumbnailService.DeleteThumbnailAsync(item.MediaId, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user