feat: load legacy Cuts and Res runtime assets
This commit is contained in:
@@ -23,6 +23,7 @@ public static class PlayoutOptionsLoader
|
||||
{
|
||||
var options = LoadJson(path ?? DefaultPath);
|
||||
ApplyEnvironment(options);
|
||||
ApplyExecutableAssetDefaults(options, AppContext.BaseDirectory);
|
||||
return options;
|
||||
}
|
||||
|
||||
@@ -42,6 +43,36 @@ public static class PlayoutOptionsLoader
|
||||
RequiredLiveAuthorizationValue,
|
||||
StringComparison.Ordinal);
|
||||
|
||||
internal static void ApplyExecutableAssetDefaults(
|
||||
PlayoutOptions options,
|
||||
string? baseDirectory)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(options);
|
||||
if (!string.IsNullOrWhiteSpace(options.SceneDirectory) ||
|
||||
string.IsNullOrWhiteSpace(baseDirectory))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var cutsDirectory = Path.Combine(
|
||||
Path.GetFullPath(baseDirectory),
|
||||
"Cuts");
|
||||
if (Directory.Exists(cutsDirectory))
|
||||
{
|
||||
options.SceneDirectory = cutsDirectory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception) when (
|
||||
exception is ArgumentException or IOException or NotSupportedException or
|
||||
System.Security.SecurityException)
|
||||
{
|
||||
// A missing or invalid executable asset root leaves the existing safe
|
||||
// configuration unchanged; validation reports it if a command needs it.
|
||||
}
|
||||
}
|
||||
|
||||
private static PlayoutOptions LoadJson(string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
|
||||
Reference in New Issue
Block a user