fix: constrain seconds and milliseconds in between
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user