fix(api): update block lookups to use all_blocks() after ScheduleConfig V2
This commit is contained in:
@@ -245,8 +245,7 @@ impl ScheduledSlotResponse {
|
|||||||
pub fn with_block_access(slot: domain::ScheduledSlot, channel: &domain::Channel) -> Self {
|
pub fn with_block_access(slot: domain::ScheduledSlot, channel: &domain::Channel) -> Self {
|
||||||
let block_access_mode = channel
|
let block_access_mode = channel
|
||||||
.schedule_config
|
.schedule_config
|
||||||
.blocks
|
.all_blocks()
|
||||||
.iter()
|
|
||||||
.find(|b| b.id == slot.source_block_id)
|
.find(|b| b.id == slot.source_block_id)
|
||||||
.map(|b| b.access_mode.clone())
|
.map(|b| b.access_mode.clone())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|||||||
@@ -61,8 +61,7 @@ pub(super) async fn get_current_broadcast(
|
|||||||
Some(broadcast) => {
|
Some(broadcast) => {
|
||||||
let block_access_mode = channel
|
let block_access_mode = channel
|
||||||
.schedule_config
|
.schedule_config
|
||||||
.blocks
|
.all_blocks()
|
||||||
.iter()
|
|
||||||
.find(|b| b.id == broadcast.slot.source_block_id)
|
.find(|b| b.id == broadcast.slot.source_block_id)
|
||||||
.map(|b| b.access_mode.clone())
|
.map(|b| b.access_mode.clone())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
@@ -168,8 +167,7 @@ pub(super) async fn get_stream(
|
|||||||
// Block-level access check
|
// Block-level access check
|
||||||
if let Some(block) = channel
|
if let Some(block) = channel
|
||||||
.schedule_config
|
.schedule_config
|
||||||
.blocks
|
.all_blocks()
|
||||||
.iter()
|
|
||||||
.find(|b| b.id == broadcast.slot.source_block_id)
|
.find(|b| b.id == broadcast.slot.source_block_id)
|
||||||
{
|
{
|
||||||
check_access(
|
check_access(
|
||||||
|
|||||||
Reference in New Issue
Block a user