Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

cleanup audio_chunk_id not nullable

cparish312c9fdb78f64bd
diff --git a/screenpipe-server/src/db.rs b/screenpipe-server/src/db.rs
index 517578796..70da671c8 100644
--- a/screenpipe-server/src/db.rs
+++ b/screenpipe-server/src/db.rs
@@ -109,10 +109,10 @@ pub enum ContentType {
#[derive(FromRow)]
struct AudioResultRaw {
- audio_chunk_id: Option<i64>,
+ audio_chunk_id: i64,
transcription: String,
timestamp: DateTime<Utc>,
- file_path: Option<String>, // Make this an Option to handle NULLs
+ file_path: String, // Make this an Option to handle NULLs
offset_index: i64,
transcription_engine: String,
tags: Option<String>,
@@ -122,7 +122,7 @@ struct AudioResultRaw {
#[derive(Debug, Serialize, Deserialize)]
pub struct AudioResult {
- pub audio_chunk_id: Option<i64>,
+ pub audio_chunk_id: i64,
pub transcription: String,
pub timestamp: DateTime<Utc>,
pub file_path: String,
@@ -642,10 +642,10 @@ impl DatabaseManager {
let audio_results = audio_results_raw
.into_iter()
.map(|raw| AudioResult {
- audio_chunk_id: raw.audio_chunk_id, // Now audio_chunk_id can be None
+ audio_chunk_id: raw.audio_chunk_id,
transcription: raw.transcription,
timestamp: raw.timestamp,
- file_path: raw.file_path.unwrap_or_default(), // Handle cases where file_path may be NULL
+ file_path: raw.file_path,
offset_index: raw.offset_index,
transcription_engine: raw.transcription_engine,
tags: raw
diff --git a/screenpipe-server/src/server.rs b/screenpipe-server/src/server.rs
index 0be75065b..c0ad936b3 100644
--- a/screenpipe-server/src/server.rs
+++ b/screenpipe-server/src/server.rs
@@ -295,7 +295,7 @@ pub(crate) async fn search(
frame: None,
}),
SearchResult::Audio(audio) => ContentItem::Audio(AudioContent {
- chunk_id: audio.audio_chunk_id.unwrap_or(-1),
+ chunk_id: audio.audio_chunk_id,
transcription: audio.transcription.clone(),
timestamp: audio.timestamp,
file_path: audio.file_path.clone(),