Compare commits
2 Commits
89445ddcf3
...
letterbox-
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a86f0d0b2 | |||
| eab4986fd3 |
52
Cargo.lock
generated
52
Cargo.lock
generated
@@ -3075,6 +3075,20 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-notmuch"
|
name = "letterbox-notmuch"
|
||||||
version = "0.17.55"
|
version = "0.17.55"
|
||||||
|
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
||||||
|
checksum = "e4d1d65ae37e0b9efbee0daf341e7e5ea2db8ae78e4ea429359c671163636283"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"mailparse",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 2.0.17",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "letterbox-notmuch"
|
||||||
|
version = "0.17.56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
@@ -3087,28 +3101,14 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "letterbox-notmuch"
|
|
||||||
version = "0.17.55"
|
|
||||||
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
|
||||||
checksum = "e4d1d65ae37e0b9efbee0daf341e7e5ea2db8ae78e4ea429359c671163636283"
|
|
||||||
dependencies = [
|
|
||||||
"log",
|
|
||||||
"mailparse",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"thiserror 2.0.17",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-procmail2notmuch"
|
name = "letterbox-procmail2notmuch"
|
||||||
version = "0.17.55"
|
version = "0.17.56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
"letterbox-notmuch 0.17.55 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
"letterbox-notmuch 0.17.55",
|
||||||
"letterbox-shared 0.17.55 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
"letterbox-shared 0.17.55",
|
||||||
"serde",
|
"serde",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
"tokio 1.48.0",
|
"tokio 1.48.0",
|
||||||
@@ -3116,7 +3116,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-server"
|
name = "letterbox-server"
|
||||||
version = "0.17.55"
|
version = "0.17.56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -3139,8 +3139,8 @@ dependencies = [
|
|||||||
"html-escape",
|
"html-escape",
|
||||||
"html2text",
|
"html2text",
|
||||||
"ical",
|
"ical",
|
||||||
"letterbox-notmuch 0.17.55",
|
"letterbox-notmuch 0.17.56",
|
||||||
"letterbox-shared 0.17.55",
|
"letterbox-shared 0.17.56",
|
||||||
"linkify",
|
"linkify",
|
||||||
"lol_html",
|
"lol_html",
|
||||||
"mailparse",
|
"mailparse",
|
||||||
@@ -3167,6 +3167,8 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-shared"
|
name = "letterbox-shared"
|
||||||
version = "0.17.55"
|
version = "0.17.55"
|
||||||
|
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
||||||
|
checksum = "efcc3a59edbda7b3a9ac419bafafd5da8fea7a757fcffd5bfd88b28fba1ad97f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"letterbox-notmuch 0.17.55",
|
"letterbox-notmuch 0.17.55",
|
||||||
@@ -3179,12 +3181,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-shared"
|
name = "letterbox-shared"
|
||||||
version = "0.17.55"
|
version = "0.17.56"
|
||||||
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
|
|
||||||
checksum = "efcc3a59edbda7b3a9ac419bafafd5da8fea7a757fcffd5bfd88b28fba1ad97f"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"letterbox-notmuch 0.17.55 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
|
"letterbox-notmuch 0.17.56",
|
||||||
"regex",
|
"regex",
|
||||||
"serde",
|
"serde",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
@@ -3194,7 +3194,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-web"
|
name = "letterbox-web"
|
||||||
version = "0.17.55"
|
version = "0.17.56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"build-info-build",
|
"build-info-build",
|
||||||
@@ -3206,7 +3206,7 @@ dependencies = [
|
|||||||
"graphql_client",
|
"graphql_client",
|
||||||
"human_format",
|
"human_format",
|
||||||
"itertools",
|
"itertools",
|
||||||
"letterbox-shared 0.17.55",
|
"letterbox-shared 0.17.56",
|
||||||
"log",
|
"log",
|
||||||
"seed",
|
"seed",
|
||||||
"seed_hooks",
|
"seed_hooks",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "UNLICENSED"
|
license = "UNLICENSED"
|
||||||
publish = ["xinu"]
|
publish = ["xinu"]
|
||||||
version = "0.17.55"
|
version = "0.17.56"
|
||||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|||||||
@@ -195,8 +195,16 @@ pub fn extract_calendar_metadata_from_mail(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let (Some(sm), Some(em)) = (month_num(start_month), month_num(end_month)) {
|
if let (Some(sm), Some(em)) = (month_num(start_month), month_num(end_month)) {
|
||||||
let current_year = chrono::Local::now().year().to_string();
|
// If start month is later in calendar year than end month, start is in previous year
|
||||||
let start = format!("{}{}{}", current_year, sm, format!("{:0>2}", start_day));
|
let sm_num: u32 = sm.parse().unwrap_or(1);
|
||||||
|
let em_num: u32 = em.parse().unwrap_or(1);
|
||||||
|
let end_year = year.parse::<i32>().unwrap_or_else(|_| chrono::Local::now().year());
|
||||||
|
let start_year: i32 = if sm_num > em_num {
|
||||||
|
end_year - 1
|
||||||
|
} else {
|
||||||
|
end_year
|
||||||
|
};
|
||||||
|
let start = format!("{}{}{}", start_year, sm, format!("{:0>2}", start_day));
|
||||||
let mut end_date_val = chrono::NaiveDate::parse_from_str(&format!("{}-{}-{}", year, em, format!("{:0>2}", end_day)), "%Y-%m-%d").ok();
|
let mut end_date_val = chrono::NaiveDate::parse_from_str(&format!("{}-{}-{}", year, em, format!("{:0>2}", end_day)), "%Y-%m-%d").ok();
|
||||||
if let Some(d) = end_date_val.as_mut() {
|
if let Some(d) = end_date_val.as_mut() {
|
||||||
*d = d.succ_opt().unwrap_or(*d);
|
*d = d.succ_opt().unwrap_or(*d);
|
||||||
@@ -2307,8 +2315,8 @@ mod tests {
|
|||||||
Some("calendar-notification@google.com".to_string())
|
Some("calendar-notification@google.com".to_string())
|
||||||
);
|
);
|
||||||
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
||||||
let current_year = chrono::Local::now().year();
|
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
@@ -2408,8 +2416,8 @@ mod tests {
|
|||||||
Some("calendar-notification@google.com".to_string())
|
Some("calendar-notification@google.com".to_string())
|
||||||
);
|
);
|
||||||
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
||||||
let current_year = chrono::Local::now().year();
|
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||||
// Debug: print the rendered HTML for inspection
|
// Debug: print the rendered HTML for inspection
|
||||||
if let Some(ref html) = meta.body_html {
|
if let Some(ref html) = meta.body_html {
|
||||||
@@ -2442,8 +2450,8 @@ mod tests {
|
|||||||
Some("calendar-notification@google.com".to_string())
|
Some("calendar-notification@google.com".to_string())
|
||||||
);
|
);
|
||||||
// Assert that the start and end dates are present
|
// Assert that the start and end dates are present
|
||||||
let current_year = chrono::Local::now().year();
|
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||||
// Assert that the HTML body contains recurrence info
|
// Assert that the HTML body contains recurrence info
|
||||||
if let Some(ref html) = meta.body_html {
|
if let Some(ref html) = meta.body_html {
|
||||||
|
|||||||
Reference in New Issue
Block a user