mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2024-12-27 15:45:55 -05:00
bugfix: in /recordings, end_id should be inclusive
This commit is contained in:
parent
5ea2c2fed1
commit
57985079cc
@ -427,9 +427,10 @@ impl Service {
|
|||||||
.ok_or_else(|| Error::new("no such camera".to_owned()))?;
|
.ok_or_else(|| Error::new("no such camera".to_owned()))?;
|
||||||
db.list_aggregated_recordings(camera.id, r, recording::Duration(i64::max_value()),
|
db.list_aggregated_recordings(camera.id, r, recording::Duration(i64::max_value()),
|
||||||
|row| {
|
|row| {
|
||||||
|
let end = row.ids.end - 1; // in api, ids are inclusive.
|
||||||
out.recordings.push(json::Recording {
|
out.recordings.push(json::Recording {
|
||||||
start_id: row.ids.start,
|
start_id: row.ids.start,
|
||||||
end_id: if row.ids.end == row.ids.start + 1 { None } else { Some(row.ids.end) },
|
end_id: if end == row.ids.start + 1 { None } else { Some(end) },
|
||||||
start_time_90k: row.time.start.0,
|
start_time_90k: row.time.start.0,
|
||||||
end_time_90k: row.time.end.0,
|
end_time_90k: row.time.end.0,
|
||||||
sample_file_bytes: row.sample_file_bytes,
|
sample_file_bytes: row.sample_file_bytes,
|
||||||
|
Loading…
Reference in New Issue
Block a user