Compare commits
21 Commits
letterbox-
...
dbf1bc17a1
| Author | SHA1 | Date | |
|---|---|---|---|
| dbf1bc17a1 | |||
| 95d06ec669 | |||
| 84810d8644 | |||
| 8a86f0d0b2 | |||
| eab4986fd3 | |||
| 3c644c570e | |||
| 7a9df3c15c | |||
| f9d8acf744 | |||
| 75f3770f3e | |||
| 85dd61a272 | |||
| 1c5412de14 | |||
| 034027ddd5 | |||
| 81a07a8172 | |||
| d9e8c2133e | |||
| 99aa7a7071 | |||
| cc585cc63f | |||
| 293f90fde5 | |||
| a06e4b3454 | |||
| 6e5145e21b | |||
| d41f3e9fd1 | |||
| 5519018043 |
986
Cargo.lock
generated
986
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
||||
edition = "2021"
|
||||
license = "UNLICENSED"
|
||||
publish = ["xinu"]
|
||||
version = "0.17.55"
|
||||
version = "0.17.56"
|
||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@@ -16,7 +16,7 @@ chrono-tz = "0.10"
|
||||
html2text = "0.16"
|
||||
ammonia = "4.1.0"
|
||||
anyhow = "1.0.98"
|
||||
askama = { version = "0.14.0", features = ["derive"] }
|
||||
askama = { version = "0.15.0", features = ["derive"] }
|
||||
async-graphql = { version = "7", features = ["log", "chrono"] }
|
||||
async-graphql-axum = "7.0.16"
|
||||
async-trait = "0.1.88"
|
||||
@@ -26,7 +26,7 @@ build-info = "0.0.42"
|
||||
cacher = { version = "0.2.0", registry = "xinu" }
|
||||
chrono = "0.4.40"
|
||||
clap = { version = "4.5.37", features = ["derive"] }
|
||||
css-inline = "0.18.0"
|
||||
css-inline = "0.19.0"
|
||||
flate2 = "1.1.2"
|
||||
futures = "0.3.31"
|
||||
headers = "0.4.0"
|
||||
@@ -41,7 +41,7 @@ maplit = "1.0.2"
|
||||
memmap = "0.7.0"
|
||||
quick-xml = { version = "0.38.1", features = ["serialize"] }
|
||||
regex = "1.11.1"
|
||||
reqwest = { version = "0.12.15", features = ["blocking"] }
|
||||
reqwest = { version = "0.13.0", features = ["blocking"] }
|
||||
scraper = "0.25.0"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
serde_json = "1.0.140"
|
||||
|
||||
@@ -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)) {
|
||||
let current_year = chrono::Local::now().year().to_string();
|
||||
let start = format!("{}{}{}", current_year, sm, format!("{:0>2}", start_day));
|
||||
// If start month is later in calendar year than end month, start is in previous year
|
||||
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();
|
||||
if let Some(d) = end_date_val.as_mut() {
|
||||
*d = d.succ_opt().unwrap_or(*d);
|
||||
@@ -2307,8 +2315,8 @@ mod tests {
|
||||
Some("calendar-notification@google.com".to_string())
|
||||
);
|
||||
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
||||
let current_year = chrono::Local::now().year();
|
||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
||||
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||
}
|
||||
#[test]
|
||||
@@ -2408,8 +2416,8 @@ mod tests {
|
||||
Some("calendar-notification@google.com".to_string())
|
||||
);
|
||||
// Dates: from subject, Thu Sep 11 to Fri Jan 30, 2026
|
||||
let current_year = chrono::Local::now().year();
|
||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
||||
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||
// Debug: print the rendered HTML for inspection
|
||||
if let Some(ref html) = meta.body_html {
|
||||
@@ -2442,8 +2450,8 @@ mod tests {
|
||||
Some("calendar-notification@google.com".to_string())
|
||||
);
|
||||
// Assert that the start and end dates are present
|
||||
let current_year = chrono::Local::now().year();
|
||||
assert_eq!(meta.start_date, Some(format!("{}0911", current_year)));
|
||||
// Start date is Sep 11, 2025 (one year before end since Sep > Jan)
|
||||
assert_eq!(meta.start_date, Some("20250911".to_string()));
|
||||
assert_eq!(meta.end_date, Some("20260131".to_string()));
|
||||
// Assert that the HTML body contains recurrence info
|
||||
if let Some(ref html) = meta.body_html {
|
||||
|
||||
Reference in New Issue
Block a user