Hero: een gewijzigd focuspunt geldt pas bij het opslaan van de hero (Bryan); het focus-venster houdt de wijziging lokaal

Het eindpunt PUT /hero/images/{id}/focus is vervallen; de focus gaat mee in de opslag (imageFocus) en de varianten worden dan in nieuwe bestanden opnieuw gesneden.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 20:05:17 +01:00
co-authored by Claude Sonnet 5.5
parent 01703ccddf
commit 0b56fa6294
20 changed files with 318 additions and 197 deletions
@@ -54,6 +54,12 @@ public class HeroController(IHeroService service, IPublicHeroService publicServi
ModelState.AddModelError(exception.Field, exception.Message);
return ValidationProblem(ModelState);
}
catch (ImageRejectedException rejection)
{
// Cutting the variants for a changed focus needs the stored original and a free processing slot.
var status = rejection.Reason == ImageRejection.Busy ? StatusCodes.Status429TooManyRequests : StatusCodes.Status503ServiceUnavailable;
return StatusCode(status, new { error = rejection.Code, message = HttpTexts.From(HttpContext).Get(HeroTexts.Image.For(rejection.Reason)) });
}
}
}
@@ -89,24 +95,6 @@ public class HeroImagesController(IHeroImageService service, IOptions<MediaOptio
}
}
[HttpPut("{id:guid}/focus")]
[ProducesResponseType<HeroImageDto>(StatusCodes.Status200OK)]
public async Task<IActionResult> SetFocus(Guid id, [FromBody] HeroFocusRequest request, CancellationToken cancellationToken)
{
try
{
return Ok(await service.SetFocusAsync(id, request, HeroCaller.Id(User), cancellationToken));
}
catch (HeroImageNotFoundException)
{
return NotFound(new { error = "not_found", message = Texts().Get(HeroTexts.Image.NotFound) });
}
catch (ImageRejectedException rejection)
{
return Rejected(rejection);
}
}
[HttpDelete("{id:guid}")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status409Conflict)]