Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON APIs for Camera and Sample File Dirs #66

Closed
wants to merge 12 commits into from
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions db/Cargo.toml
Expand Up @@ -34,3 +34,5 @@ tempdir = "0.3"
time = "0.1"
uuid = { version = "0.7", features = ["std", "v4"] }
itertools = "0.8.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
5 changes: 3 additions & 2 deletions db/db.rs
Expand Up @@ -58,6 +58,7 @@ use crate::dir;
use crate::raw;
use crate::recording::{self, TIME_UNITS_PER_SEC};
use crate::schema;
use serde::{Serialize, Deserialize};
use failure::{Error, bail, format_err};
use fnv::{FnvHashMap, FnvHashSet};
use itertools::Itertools;
Expand Down Expand Up @@ -460,7 +461,7 @@ pub struct LiveSegment {
pub off_90k: Range<i32>,
}

#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct StreamChange {
pub sample_file_dir_id: Option<i32>,
pub rtsp_path: String,
Expand All @@ -469,7 +470,7 @@ pub struct StreamChange {
}

/// Information about a camera, used by `add_camera` and `update_camera`.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CameraChange {
pub short_name: String,
pub description: String,
Expand Down