testing using ffmpeg to generate thumbnails for avif

This commit is contained in:
2025-08-17 03:16:19 -04:00
parent d36aaac836
commit 8808126905
4 changed files with 104 additions and 1 deletions

View File

@@ -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;

View 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);
}
}
}
}