Fase 3a: bibliotheektabellen krijgen set, varianten en uitsnede-overrides (additief), kopie, schrijf-door en controle vullen en vergelijken ze

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 00:00:59 +01:00
co-authored by Claude Sonnet 5.5
parent e1f2abf004
commit 53e1e3c8a6
14 changed files with 429 additions and 9 deletions
@@ -40,7 +40,8 @@ public class HeroMediaMigrationSource(IHeroRepository repository) : IMediaMigrat
}
}
uses.Add(new MediaUseSnapshot(slide.Id, slide.ImageId, Module, HeroMediaUsageProvider.SlideKind, index + 1, slide.IsActive, setHash, crops));
var variantsJson = slide.HasOwnCrop && slide.Variants is { Count: > 0 } ? Json(slide.Variants) : null;
uses.Add(new MediaUseSnapshot(slide.Id, slide.ImageId, Module, HeroMediaUsageProvider.SlideKind, index + 1, slide.IsActive, setHash, crops, variantsJson));
}
}
@@ -66,7 +67,17 @@ public class HeroMediaMigrationSource(IHeroRepository repository) : IMediaMigrat
i.CreatedByUserId,
i.OriginalFileName,
i.LastUsedAt,
i.DeletedAt);
i.DeletedAt,
Json(i.Variants),
i.WideFocusX,
i.WideFocusY,
i.WideZoom,
i.TallFocusX,
i.TallFocusY,
i.TallZoom);
/// <summary>The variants as the hero stores them (the same serializer as its database column), so they can go back unchanged.</summary>
public static string Json(IEnumerable<HeroVariant> variants) => System.Text.Json.JsonSerializer.Serialize(variants.ToList(), (System.Text.Json.JsonSerializerOptions?)null);
private static MediaCropSnapshot Crop(string ratio, HeroImage image)
{