From 04c955aad1ea6ab0927aef79f27d02ecdf0c2f33 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 25 Jul 2023 11:58:00 +0200 Subject: [PATCH] sort filler list, set index --- lib/src/utils/folder.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/utils/folder.rs b/lib/src/utils/folder.rs index 5bb841e3..74a459b7 100644 --- a/lib/src/utils/folder.rs +++ b/lib/src/utils/folder.rs @@ -183,6 +183,12 @@ pub fn fill_filler_list(config: PlayoutConfig, player_control: PlayerControl) { let mut rng = thread_rng(); filler_list.shuffle(&mut rng); + } else { + filler_list.sort_by(|d1, d2| d1.source.cmp(&d2.source)); + } + + for (index, item) in filler_list.iter_mut().enumerate() { + item.index = Some(index); } } else { filler_list.push(Media::new(0, &config.storage.filler, false));