mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-04-15 16:48:10 -04:00
add start_id and end_id to .../recordings json
This was added to the API documentation in eee887b9 but never actually implemented then. It's necessary to actually fetch the .mp4 in question.
This commit is contained in:
parent
7673a00bd9
commit
bd4104b446
@ -125,7 +125,11 @@ pub struct Recording {
|
|||||||
pub end_time_90k: i64,
|
pub end_time_90k: i64,
|
||||||
pub sample_file_bytes: i64,
|
pub sample_file_bytes: i64,
|
||||||
pub video_samples: i64,
|
pub video_samples: i64,
|
||||||
|
pub video_sample_entry_sha1: String,
|
||||||
|
pub start_id: i32,
|
||||||
|
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub end_id: Option<i32>,
|
||||||
pub video_sample_entry_width: u16,
|
pub video_sample_entry_width: u16,
|
||||||
pub video_sample_entry_height: u16,
|
pub video_sample_entry_height: u16,
|
||||||
pub video_sample_entry_sha1: String,
|
|
||||||
}
|
}
|
||||||
|
@ -427,7 +427,9 @@ 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| {
|
||||||
out.recordings.push(json::Recording{
|
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) },
|
||||||
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…
x
Reference in New Issue
Block a user