From 57985079cc55bb8407f3267da9ce7ed4c35e6145 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Wed, 4 Oct 2017 06:36:30 -0700 Subject: [PATCH] bugfix: in /recordings, end_id should be inclusive --- src/web.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/web.rs b/src/web.rs index dc8a926..07a956b 100644 --- a/src/web.rs +++ b/src/web.rs @@ -427,9 +427,10 @@ impl Service { .ok_or_else(|| Error::new("no such camera".to_owned()))?; db.list_aggregated_recordings(camera.id, r, recording::Duration(i64::max_value()), |row| { + let end = row.ids.end - 1; // in api, ids are inclusive. out.recordings.push(json::Recording { 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, end_time_90k: row.time.end.0, sample_file_bytes: row.sample_file_bytes,