Cleanup unused message embedding code
Fixup some warnings
This commit is contained in:
@@ -86,9 +86,10 @@ impl InsightGenerator {
|
||||
// If path has at least 2 components (directory + file), extract first directory
|
||||
if components.len() >= 2
|
||||
&& let Some(component) = components.first()
|
||||
&& let Some(os_str) = component.as_os_str().to_str() {
|
||||
return Some(os_str.to_string());
|
||||
}
|
||||
&& let Some(os_str) = component.as_os_str().to_str()
|
||||
{
|
||||
return Some(os_str.to_string());
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
@@ -190,20 +191,19 @@ impl InsightGenerator {
|
||||
.filter(|msg| {
|
||||
// Extract date from formatted daily summary "[2024-08-15] Contact ..."
|
||||
if let Some(bracket_end) = msg.find(']')
|
||||
&& let Some(date_str) = msg.get(1..bracket_end) {
|
||||
// Parse just the date (daily summaries don't have time)
|
||||
if let Ok(msg_date) =
|
||||
chrono::NaiveDate::parse_from_str(date_str, "%Y-%m-%d")
|
||||
{
|
||||
let msg_timestamp = msg_date
|
||||
.and_hms_opt(12, 0, 0)
|
||||
.unwrap()
|
||||
.and_utc()
|
||||
.timestamp();
|
||||
let time_diff = (photo_timestamp - msg_timestamp).abs();
|
||||
return time_diff > exclusion_window;
|
||||
}
|
||||
&& let Some(date_str) = msg.get(1..bracket_end)
|
||||
{
|
||||
// Parse just the date (daily summaries don't have time)
|
||||
if let Ok(msg_date) = chrono::NaiveDate::parse_from_str(date_str, "%Y-%m-%d") {
|
||||
let msg_timestamp = msg_date
|
||||
.and_hms_opt(12, 0, 0)
|
||||
.unwrap()
|
||||
.and_utc()
|
||||
.timestamp();
|
||||
let time_diff = (photo_timestamp - msg_timestamp).abs();
|
||||
return time_diff > exclusion_window;
|
||||
}
|
||||
}
|
||||
false
|
||||
})
|
||||
.take(limit)
|
||||
|
||||
Reference in New Issue
Block a user