Sync selected cut duration from schedule edits

This commit is contained in:
2026-05-14 12:24:00 +09:00
parent 24915c1dca
commit df01f07c44
2 changed files with 21 additions and 0 deletions

View File

@@ -1113,6 +1113,17 @@ public sealed class ChannelScheduleViewModel : ObservableObject
NotifySelectedFormatDurationStateChanged();
}
public void RefreshSelectedFormatDuration(FormatTemplateDefinition template)
{
if (SelectedFormat is null ||
!string.Equals(SelectedFormat.Id, template.Id, StringComparison.Ordinal))
{
return;
}
ResetSelectedFormatDurationDraft();
}
private void NotifySelectedFormatDurationStateChanged()
{
OnPropertyChanged(

View File

@@ -1432,6 +1432,7 @@ public sealed class MainViewModel : ObservableObject
private void OnCutDurationChanged(FormatTemplateDefinition template)
{
SyncQueuedCutDurations(template);
RefreshSelectedFormatDurations(template);
QueueAutomaticSave();
}
@@ -1474,6 +1475,7 @@ public sealed class MainViewModel : ObservableObject
{
RefreshCutListEntries(template);
SyncQueuedCutDurations(template);
RefreshSelectedFormatDurations(template);
QueueAutomaticSave();
}
}
@@ -1487,6 +1489,14 @@ public sealed class MainViewModel : ObservableObject
}
}
private void RefreshSelectedFormatDurations(FormatTemplateDefinition template)
{
foreach (var channel in Channels)
{
channel.RefreshSelectedFormatDuration(template);
}
}
private void ApplyCutDurations(IReadOnlyDictionary<string, double>? durations)
{
if (durations is null || durations.Count == 0)