fix: use StdRng for shuffling indices in fill_block function

This commit is contained in:
2026-03-20 23:12:44 +01:00
parent f45ca77b79
commit e3a65d8052

View File

@@ -1,6 +1,8 @@
use std::collections::HashSet;
use rand::rngs::StdRng;
use rand::seq::SliceRandom;
use rand::SeedableRng;
use crate::entities::MediaItem;
use crate::value_objects::{FillStrategy, MediaItemId};
@@ -20,7 +22,7 @@ pub(super) fn fill_block<'a>(
}
FillStrategy::Random => {
let mut indices: Vec<usize> = (0..pool.len()).collect();
indices.shuffle(&mut rand::thread_rng());
indices.shuffle(&mut StdRng::from_entropy());
let mut remaining = target_secs;
let mut result = Vec::new();
for i in indices {