mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-25 03:56:18 -05:00
allow listing and viewing uncommitted recordings
There may be considerable lag between being fully written and being committed when using the flush_if_sec feature. Additionally, this is a step toward listing and viewing recordings before they're fully written. That's a considerable delay: 60 to 120 seconds for the first recording of a run, 0 to 60 seconds for subsequent recordings. These recordings aren't yet included in the information returned by /api/?days=true. They probably should be, but small steps.
This commit is contained in:
@@ -49,7 +49,8 @@ const LIST_RECORDINGS_BY_TIME_SQL: &'static str = r#"
|
||||
recording.sample_file_bytes,
|
||||
recording.video_samples,
|
||||
recording.video_sync_samples,
|
||||
recording.video_sample_entry_id
|
||||
recording.video_sample_entry_id,
|
||||
recording.open_id
|
||||
from
|
||||
recording
|
||||
where
|
||||
@@ -71,7 +72,8 @@ const LIST_RECORDINGS_BY_ID_SQL: &'static str = r#"
|
||||
recording.sample_file_bytes,
|
||||
recording.video_samples,
|
||||
recording.video_sync_samples,
|
||||
recording.video_sample_entry_id
|
||||
recording.video_sample_entry_id,
|
||||
recording.open_id
|
||||
from
|
||||
recording
|
||||
where
|
||||
@@ -173,6 +175,7 @@ fn list_recordings_inner(mut rows: rusqlite::Rows,
|
||||
video_samples: row.get_checked(6)?,
|
||||
video_sync_samples: row.get_checked(7)?,
|
||||
video_sample_entry_id: row.get_checked(8)?,
|
||||
open_id: row.get_checked(9)?,
|
||||
})?;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user