Skip to content

Commit

Permalink
added monitor device in vision tables and search query
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh9485 committed Feb 1, 2025
1 parent 1a951e1 commit 75c6688
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions screenpipe-server/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ impl DatabaseManager {
min_length,
max_length,
frame_name,
monitor_device
),
self.search_audio(
query,
Expand Down Expand Up @@ -523,6 +524,7 @@ impl DatabaseManager {
min_length,
max_length,
frame_name,
monitor_device
),
self.search_ui_monitoring(
query,
Expand Down Expand Up @@ -556,6 +558,7 @@ impl DatabaseManager {
min_length,
max_length,
frame_name,
monitor_device
)
.await?;
results.extend(ocr_results.into_iter().map(SearchResult::OCR));
Expand Down Expand Up @@ -632,6 +635,7 @@ impl DatabaseManager {
min_length,
max_length,
frame_name,
monitor_device
)
.await?;
let ui_results = self
Expand Down Expand Up @@ -674,6 +678,7 @@ impl DatabaseManager {
min_length,
max_length,
frame_name,
monitor_device
)
.await?;

Expand Down Expand Up @@ -720,6 +725,7 @@ impl DatabaseManager {
min_length: Option<usize>,
max_length: Option<usize>,
frame_name: Option<&str>,
monitor_device: Option<&str>
) -> Result<Vec<OCRResult>, sqlx::Error> {
let base_sql = if query.is_empty() {
"ocr_text"
Expand Down Expand Up @@ -779,6 +785,7 @@ impl DatabaseManager {
.bind(limit)
.bind(offset)
.bind(frame_name)
.bind(monitor_device)
.fetch_all(&self.pool)
.await?;

Expand All @@ -790,6 +797,7 @@ impl DatabaseManager {
text_json: raw.text_json,
timestamp: raw.timestamp,
frame_name: raw.frame_name,
monitor_device: raw.monitor_device,
file_path: raw.file_path,
offset_index: raw.offset_index,
app_name: raw.app_name,
Expand Down Expand Up @@ -2095,6 +2103,7 @@ impl DatabaseManager {
ocr_engine: raw.ocr_engine,
window_name: raw.window_name,
frame_name: raw.frame_name,
monitor_device: raw.monitor_device,
tags: raw
.tags
.map(|t| t.split(',').map(String::from).collect())
Expand Down
2 changes: 2 additions & 0 deletions screenpipe-server/src/db_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct OCRResultRaw {
pub ocr_engine: String,
pub window_name: String,
pub tags: Option<String>,
pub monitor_device: Option<String>
}

#[derive(Debug, Serialize, Deserialize)]
Expand All @@ -51,6 +52,7 @@ pub struct OCRResult {
pub ocr_engine: String,
pub window_name: String,
pub tags: Vec<String>,
pub monitor_device: Option<String>,
}

#[derive(Debug, Deserialize, PartialEq, Default, Clone)]
Expand Down

0 comments on commit 75c6688

Please sign in to comment.