fix: add identity_uuid to /identities list + /file/:uuid/identities responses
This commit is contained in:
@@ -58,6 +58,7 @@ pub struct CandidateRecord {
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, sqlx::FromRow)]
|
||||
pub struct FileIdentityRecord {
|
||||
pub identity_id: i32,
|
||||
pub identity_uuid: Option<uuid::Uuid>,
|
||||
pub name: String,
|
||||
pub metadata: serde_json::Value,
|
||||
pub face_count: Option<i32>,
|
||||
@@ -2406,7 +2407,7 @@ impl PostgresDb {
|
||||
let videos_table = schema::table_name("videos");
|
||||
let query = format!(
|
||||
r#"
|
||||
SELECT fd.identity_id::int4, i.name, i.metadata,
|
||||
SELECT fd.identity_id::int4, i.uuid as identity_uuid, i.name, i.metadata,
|
||||
COUNT(*)::int4 as face_count,
|
||||
0::int4 as speaker_count,
|
||||
MIN(fd.frame_number) as start_frame,
|
||||
@@ -2416,7 +2417,7 @@ impl PostgresDb {
|
||||
FROM {} fd
|
||||
JOIN {} i ON fd.identity_id = i.id
|
||||
WHERE fd.file_uuid = $1 AND fd.identity_id IS NOT NULL
|
||||
GROUP BY fd.identity_id, i.name, i.metadata
|
||||
GROUP BY fd.identity_id, i.name, i.metadata, i.uuid
|
||||
ORDER BY confidence DESC
|
||||
LIMIT $2 OFFSET $3
|
||||
"#,
|
||||
|
||||
Reference in New Issue
Block a user