Fix TV index not being sorted

This commit is contained in:
Shadowfacts 2025-02-12 16:03:04 -05:00
parent 5460b73230
commit 717c661c75

View File

@ -322,11 +322,15 @@ struct ShowIndex(DynamicInput<Option<Show>>);
impl Rule for ShowIndex {
type Output = Vec<ShowIndexEntry>;
fn evaluate(&mut self) -> Self::Output {
self.input_0()
let mut entries = self
.input_0()
.inputs
.iter()
.flat_map(|inp| inp.value().as_ref().map(ShowIndexEntry::new))
.collect()
.collect::<Vec<_>>();
entries.sort_by_key(|e| e.last_updated);
entries.reverse();
entries
}
}