generate thumbnails
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Isopoh.Cryptography.Argon2" Version="2.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.10.0" />
|
||||
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.11.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
|
||||
<PackageReference Include="MimeTypesMap" Version="1.0.9" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
|
||||
|
||||
@@ -44,9 +44,11 @@ public class MediaController(AobaService aobaService, ILogger<MediaController> l
|
||||
}
|
||||
|
||||
[HttpGet("thumb/{id}")]
|
||||
public async Task<IActionResult> ThumbAsync(ObjectId id)
|
||||
public async Task<IActionResult> ThumbAsync(ObjectId id, [FromServices] ThumbnailService thumbnailService, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
return NoContent();
|
||||
var thumb = await thumbnailService.GetThumbnailFromFileAsync(id, cancellationToken);
|
||||
if (thumb == null)
|
||||
return NotFound();
|
||||
return File(thumb, "image/webp", true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public static class OpenTelemetry
|
||||
|
||||
public static IEndpointRouteBuilder MapObserability(this IEndpointRouteBuilder endpoints)
|
||||
{
|
||||
endpoints.MapPrometheusScrapingEndpoint().RequireAuthorization(p => p.RequireRole("metrics"));
|
||||
endpoints.MapPrometheusScrapingEndpoint().RequireAuthorization();
|
||||
return endpoints;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,10 +60,6 @@ builder.Services.AddCors(o =>
|
||||
p.AllowAnyHeader();
|
||||
p.WithExposedHeaders("Grpc-Status", "Grpc-Message", "Grpc-Encoding", "Grpc-Accept-Encoding");
|
||||
p.AllowAnyOrigin();
|
||||
//#if DEBUG
|
||||
//#else
|
||||
// p.WithOrigins("https://aoba.app", "https://grpc.aoba.app");
|
||||
//#endif
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user