From e31d5716b6a1c10cf0f019409e12190d78ba7a69 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 14 Jan 2026 15:21:44 -0500 Subject: [PATCH] Additional cleanup and warning fixing --- src/ai/sms_client.rs | 16 ---------------- src/file_types.rs | 3 +++ src/state.rs | 5 ----- src/tags.rs | 4 ++++ src/video/mod.rs | 1 + 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/ai/sms_client.rs b/src/ai/sms_client.rs index ea91ae1..23b1b0f 100644 --- a/src/ai/sms_client.rs +++ b/src/ai/sms_client.rs @@ -1,5 +1,4 @@ use anyhow::Result; -use chrono::NaiveDate; use reqwest::Client; use serde::Deserialize; @@ -21,21 +20,6 @@ impl SmsApiClient { } } - pub async fn fetch_messages_for_date(&self, date: NaiveDate) -> Result> { - // Calculate date range (midnight to midnight in local time) - let start = date - .and_hms_opt(0, 0, 0) - .ok_or_else(|| anyhow::anyhow!("Invalid start time"))?; - let end = date - .and_hms_opt(23, 59, 59) - .ok_or_else(|| anyhow::anyhow!("Invalid end time"))?; - - let start_ts = start.and_utc().timestamp(); - let end_ts = end.and_utc().timestamp(); - - self.fetch_messages(start_ts, end_ts, None, None).await - } - /// Fetch messages for a specific contact within ±1 day of the given timestamp /// Falls back to all contacts if no messages found for the specific contact /// Messages are sorted by proximity to the center timestamp diff --git a/src/file_types.rs b/src/file_types.rs index 4db837c..c1249d0 100644 --- a/src/file_types.rs +++ b/src/file_types.rs @@ -35,16 +35,19 @@ pub fn is_media_file(path: &Path) -> bool { } /// Check if a DirEntry is an image file (for walkdir usage) +#[allow(dead_code)] pub fn direntry_is_image(entry: &DirEntry) -> bool { is_image_file(entry.path()) } /// Check if a DirEntry is a video file (for walkdir usage) +#[allow(dead_code)] pub fn direntry_is_video(entry: &DirEntry) -> bool { is_video_file(entry.path()) } /// Check if a DirEntry is a media file (for walkdir usage) +#[allow(dead_code)] pub fn direntry_is_media(entry: &DirEntry) -> bool { is_media_file(entry.path()) } diff --git a/src/state.rs b/src/state.rs index f744715..ac55245 100644 --- a/src/state.rs +++ b/src/state.rs @@ -20,7 +20,6 @@ pub struct AppState { pub ollama: OllamaClient, pub sms_client: SmsApiClient, pub insight_generator: InsightGenerator, - pub insight_dao: Arc>>, } impl AppState { @@ -34,7 +33,6 @@ impl AppState { ollama: OllamaClient, sms_client: SmsApiClient, insight_generator: InsightGenerator, - insight_dao: Arc>>, ) -> Self { let playlist_generator = PlaylistGenerator::new(); let video_playlist_manager = @@ -51,7 +49,6 @@ impl AppState { ollama, sms_client, insight_generator, - insight_dao, } } @@ -132,7 +129,6 @@ impl Default for AppState { ollama, sms_client, insight_generator, - insight_dao, ) } } @@ -201,7 +197,6 @@ impl AppState { ollama, sms_client, insight_generator, - insight_dao, ) } } diff --git a/src/tags.rs b/src/tags.rs index 0d00369..ef23ec6 100644 --- a/src/tags.rs +++ b/src/tags.rs @@ -260,9 +260,13 @@ pub struct InsertTaggedPhoto { #[derive(Queryable, Clone, Debug)] pub struct TaggedPhoto { + #[allow(dead_code)] // Part of API contract pub id: i32, + #[allow(dead_code)] // Part of API contract pub photo_name: String, + #[allow(dead_code)] // Part of API contract pub tag_id: i32, + #[allow(dead_code)] // Part of API contract pub created_time: i64, } diff --git a/src/video/mod.rs b/src/video/mod.rs index 9889243..1089301 100644 --- a/src/video/mod.rs +++ b/src/video/mod.rs @@ -10,6 +10,7 @@ use walkdir::WalkDir; pub mod actors; pub mod ffmpeg; +#[allow(dead_code)] pub async fn generate_video_gifs() { tokio::spawn(async { info!("Starting to make video gifs");