fix(art): re-seed a bundled background when the stored bytes differ
The creator's profile still showed the previous Starting art after the replacement, with `Art.DefaultVersion = 4` recorded — so the version gate had already declared itself done. It compared a constant against the embedded resource, and those two were compiled at different moments (version 4 landed with the OLD image embedded; the corrected image reached the assembly one build later). A version bump can always be raced that way. The seed now compares BYTES: `LayoutStore.AssetMatches` hashes the bundled resource and checks the row the background already points at. Same bytes → leave it untouched (so this is idempotent and never churns the database). Different bytes → re-stamp. The version constant and its setting are gone, because a heal that only runs once can silently skip the one launch it was needed for. `SceneThumbnailTests` planted its own art on a background still flagged as default art — in the real app that state only ever means stale bundled art, because Browse… sets the path and clears the flag. The fixture now models a creator's own picture. Tests: 572 green, 0 warnings. Verified the profile's Starting asset hash (167CDD3B…, the two-category render) differs from the shipped `starting-background.jpg` (5FC6DD22…), so the next launch re-seeds it.
This commit is contained in:
@@ -263,6 +263,11 @@ public sealed class SceneThumbnailTests
|
||||
var id = LayoutStore.Instance!.UpsertAsset(bytes, 320, 180);
|
||||
Assert.NotNull(id);
|
||||
bg!.AssetId = id;
|
||||
// The creator's own picture, not the shipped art: a default-art background pointing at
|
||||
// other bytes is re-seeded by StampDefaultBackgroundAsset (2026-11-06), and this fixture
|
||||
// needs its planted art to stay put. Browse… always sets the path alongside the asset.
|
||||
bg.UseDefaultBackground = false;
|
||||
bg.CustomBackgroundPath = Path.Combine(Path.GetTempPath(), $"ytLive-missing-{i}.jpg");
|
||||
backgroundIds[scene.Name] = id;
|
||||
}
|
||||
builder.SaveLayoutNow();
|
||||
|
||||
Reference in New Issue
Block a user