wire gap_filler into schedule engine, API, MCP

This commit is contained in:
2026-07-12 14:08:55 +02:00
parent 8edd7a9c0b
commit 79e975f057
9 changed files with 243 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
use domain::models::ScheduleConfig;
use domain::value_objects::{ChannelId, RotationPolicy, UserId};
use domain::value_objects::{ChannelId, MediaFilter, RotationPolicy, UserId};
pub struct CreateChannelCommand {
pub owner_id: UserId,
@@ -16,6 +16,7 @@ pub struct UpdateChannelCommand {
pub schedule_config: Option<ScheduleConfig>,
pub rotation_policy: Option<RotationPolicy>,
pub auto_schedule: Option<bool>,
pub gap_filler: Option<Option<MediaFilter>>,
}
pub struct DeleteChannelCommand {

View File

@@ -45,6 +45,7 @@ async fn updates_channel_name() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await
@@ -82,6 +83,7 @@ async fn update_fails_if_not_owner() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await;
@@ -108,6 +110,7 @@ async fn update_nonexistent_channel_returns_not_found() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await;
@@ -148,6 +151,7 @@ async fn update_config_creates_snapshot() {
schedule_config: Some(new_config),
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await
@@ -187,6 +191,7 @@ async fn update_without_config_skips_snapshot() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await
@@ -225,6 +230,7 @@ async fn update_description_clear() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await
@@ -243,6 +249,7 @@ async fn update_description_clear() {
schedule_config: None,
rotation_policy: None,
auto_schedule: None,
gap_filler: None,
},
)
.await

View File

@@ -35,6 +35,9 @@ pub async fn execute(deps: &ChannelCommandDeps, cmd: UpdateChannelCommand) -> Do
if let Some(auto) = cmd.auto_schedule {
channel.set_auto_schedule(auto);
}
if let Some(gap_filler) = cmd.gap_filler {
channel.set_gap_filler(gap_filler);
}
deps.channel_command.save(&channel).await?;