From 4463ff7b3ad87106997d0fe737aed6acbada2164 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 28 May 2026 02:35:07 -0400 Subject: [PATCH] fix: constrain seconds and milliseconds in `between` --- src/recording_data/between.rs | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/recording_data/between.rs b/src/recording_data/between.rs index f4d4fd0..e8d1452 100644 --- a/src/recording_data/between.rs +++ b/src/recording_data/between.rs @@ -115,6 +115,42 @@ impl RecordingManager { .await; } Ok(clip) => { + let mut second_start = start.second(); + let mut second_end = end.second(); + + if minute > minute_start { + second_start = 0; + } + + if minute < minute_end { + second_end = 59; + } + + let seconds = second_start..=second_end; + + let second = clip.second; + if !seconds.contains(&second) { + continue; + } + + let mut microsecond_start = start.microsecond(); + let mut microsecond_end = end.microsecond(); + + if second > second_start { + microsecond_start = 0; + } + + if second < second_end { + microsecond_end = 999_999; + } + + let microseconds = microsecond_start..=microsecond_end; + + let microsecond = clip.microsecond; + if !microseconds.contains(µsecond) { + continue; + } + let recording = Recording { year, month,