the ai is an overthinking fucking moron who needs it's plug pulled until such time it can repeat a similar action with its head and ass
This commit is contained in:
+24
-12
@@ -677,13 +677,22 @@ public class LayoutStore : IDisposable
|
||||
foreach (var config in configs)
|
||||
scene.Elements.Add(config);
|
||||
|
||||
var path = GetSetting($"BackgroundPath_{scene.Id}");
|
||||
if (!string.IsNullOrWhiteSpace(path))
|
||||
scene.CustomBackgroundPath = path;
|
||||
var bg = scene.Elements.OfType<Source>().FirstOrDefault(s => s.IsBackground);
|
||||
if (bg != null)
|
||||
{
|
||||
// Load from source-keyed settings (new) or scene-keyed (legacy migration)
|
||||
var path = GetSetting($"BackgroundPath_{bg.Id}");
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
path = GetSetting($"BackgroundPath_{scene.Id}");
|
||||
if (!string.IsNullOrWhiteSpace(path))
|
||||
bg.CustomBackgroundPath = path;
|
||||
|
||||
var useDefault = GetSetting($"BackgroundUseDefault_{scene.Id}");
|
||||
if (useDefault == "0")
|
||||
scene.UseDefaultBackground = false;
|
||||
var useDefault = GetSetting($"BackgroundUseDefault_{bg.Id}");
|
||||
if (string.IsNullOrWhiteSpace(useDefault))
|
||||
useDefault = GetSetting($"BackgroundUseDefault_{scene.Id}");
|
||||
if (useDefault == "0")
|
||||
bg.UseDefaultBackground = false;
|
||||
}
|
||||
}
|
||||
|
||||
return scenes;
|
||||
@@ -1025,12 +1034,15 @@ public class LayoutStore : IDisposable
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
// Save custom background paths and use-default flags
|
||||
// Save custom background paths and use-default flags per background source
|
||||
foreach (var scene in scenes)
|
||||
{
|
||||
var pathKey = $"BackgroundPath_{scene.Id}";
|
||||
if (!string.IsNullOrWhiteSpace(scene.CustomBackgroundPath))
|
||||
UpsertSetting(pathKey, scene.CustomBackgroundPath);
|
||||
var bg = scene.Elements.OfType<Source>().FirstOrDefault(s => s.IsBackground);
|
||||
if (bg == null) continue;
|
||||
|
||||
var pathKey = $"BackgroundPath_{bg.Id}";
|
||||
if (!string.IsNullOrWhiteSpace(bg.CustomBackgroundPath))
|
||||
UpsertSetting(pathKey, bg.CustomBackgroundPath);
|
||||
else
|
||||
{
|
||||
using var del = _connection.CreateCommand();
|
||||
@@ -1039,8 +1051,8 @@ public class LayoutStore : IDisposable
|
||||
del.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
var defaultKey = $"BackgroundUseDefault_{scene.Id}";
|
||||
UpsertSetting(defaultKey, scene.UseDefaultBackground ? "1" : "0");
|
||||
var defaultKey = $"BackgroundUseDefault_{bg.Id}";
|
||||
UpsertSetting(defaultKey, bg.UseDefaultBackground ? "1" : "0");
|
||||
}
|
||||
|
||||
tx.Commit();
|
||||
|
||||
Reference in New Issue
Block a user