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:
@@ -122,6 +122,10 @@ public sealed class MediaLibraryCopier(MediaDbContext db, IEnumerable<IMediaMigr
|
||||
row.OriginalFileName = snapshot.OriginalFileName;
|
||||
row.LastUsedAt = snapshot.LastUsedAt;
|
||||
row.DeletedAt = snapshot.DeletedAt;
|
||||
row.SetHash = snapshot.SetHash;
|
||||
row.Variants = snapshot.VariantsJson;
|
||||
(row.WideFocusX, row.WideFocusY, row.WideZoom) = (snapshot.WideFocusX, snapshot.WideFocusY, snapshot.WideZoom);
|
||||
(row.TallFocusX, row.TallFocusY, row.TallZoom) = (snapshot.TallFocusX, snapshot.TallFocusY, snapshot.TallZoom);
|
||||
}
|
||||
|
||||
// Uses reference their asset; the crops of a use are the crops of its photo (the hero's wide and tall).
|
||||
@@ -140,6 +144,7 @@ public sealed class MediaLibraryCopier(MediaDbContext db, IEnumerable<IMediaMigr
|
||||
row.Position = snapshot.Position;
|
||||
row.Active = snapshot.Active;
|
||||
row.SetHash = snapshot.SetHash;
|
||||
row.Variants = snapshot.VariantsJson;
|
||||
row.Crops = snapshot.Crops is not null ? JsonSerializer.Serialize(snapshot.Crops, Json) : cropsByAsset.TryGetValue(snapshot.AssetId, out var crops) ? crops : "[]";
|
||||
}
|
||||
|
||||
@@ -186,6 +191,10 @@ public sealed class MediaLibraryCopier(MediaDbContext db, IEnumerable<IMediaMigr
|
||||
{
|
||||
differences.Add($"photo {asset.Id}: hash, key or size differs");
|
||||
}
|
||||
else if (copy.SetHash != asset.SetHash || copy.Variants != asset.VariantsJson)
|
||||
{
|
||||
differences.Add($"photo {asset.Id}: set hash or variants differ");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var use in uses)
|
||||
@@ -194,9 +203,9 @@ public sealed class MediaLibraryCopier(MediaDbContext db, IEnumerable<IMediaMigr
|
||||
{
|
||||
differences.Add($"use {use.Id} is missing in the copy");
|
||||
}
|
||||
else if (copy.SetHash != use.SetHash || copy.AssetId != use.AssetId)
|
||||
else if (copy.SetHash != use.SetHash || copy.AssetId != use.AssetId || copy.Variants != use.VariantsJson)
|
||||
{
|
||||
differences.Add($"use {use.Id}: set hash or photo differs");
|
||||
differences.Add($"use {use.Id}: set hash, variants or photo differs");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user