Additional cleanup and warning fixing

This commit is contained in:
Cameron
2026-01-14 15:21:44 -05:00
parent 02ca60a5d0
commit e31d5716b6
5 changed files with 8 additions and 21 deletions

View File

@@ -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<Vec<SmsMessage>> {
// 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

View File

@@ -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())
}

View File

@@ -20,7 +20,6 @@ pub struct AppState {
pub ollama: OllamaClient,
pub sms_client: SmsApiClient,
pub insight_generator: InsightGenerator,
pub insight_dao: Arc<Mutex<Box<dyn InsightDao>>>,
}
impl AppState {
@@ -34,7 +33,6 @@ impl AppState {
ollama: OllamaClient,
sms_client: SmsApiClient,
insight_generator: InsightGenerator,
insight_dao: Arc<Mutex<Box<dyn InsightDao>>>,
) -> 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,
)
}
}

View File

@@ -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,
}

View File

@@ -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");