Compare commits
34 Commits
232a14fd96
...
letterbox-
| Author | SHA1 | Date | |
|---|---|---|---|
| c85832c93b | |||
| 7e991186fe | |||
| 95d06ec669 | |||
| 84810d8644 | |||
| 8a86f0d0b2 | |||
| eab4986fd3 | |||
| 3c644c570e | |||
| 7a9df3c15c | |||
| f9d8acf744 | |||
| 75f3770f3e | |||
| 85dd61a272 | |||
| 1c5412de14 | |||
| 034027ddd5 | |||
| 81a07a8172 | |||
| d9e8c2133e | |||
| 99aa7a7071 | |||
| cc585cc63f | |||
| 293f90fde5 | |||
| a06e4b3454 | |||
| 6e5145e21b | |||
| d41f3e9fd1 | |||
| 5519018043 | |||
| e3121219b6 | |||
| 7272bbb6b0 | |||
| dc741f421b | |||
| 69d3b8a210 | |||
| f5c4067291 | |||
| 930a45cbad | |||
| ef612c0d4f | |||
| 723e9c5ff5 | |||
| 0fdcfabfbe | |||
| b6c3f014cb | |||
| 1937bb4c99 | |||
| cdd5d9befc |
800
Cargo.lock
generated
800
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"
|
edition = "2021"
|
||||||
license = "UNLICENSED"
|
license = "UNLICENSED"
|
||||||
publish = ["xinu"]
|
publish = ["xinu"]
|
||||||
version = "0.17.54"
|
version = "0.17.57"
|
||||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ memmap = "0.7.0"
|
|||||||
quick-xml = { version = "0.38.1", features = ["serialize"] }
|
quick-xml = { version = "0.38.1", features = ["serialize"] }
|
||||||
regex = "1.11.1"
|
regex = "1.11.1"
|
||||||
reqwest = { version = "0.12.15", features = ["blocking"] }
|
reqwest = { version = "0.12.15", features = ["blocking"] }
|
||||||
scraper = "0.24.0"
|
scraper = "0.25.0"
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
serde_json = "1.0.140"
|
serde_json = "1.0.140"
|
||||||
sqlx = { version = "0.8.5", features = ["postgres", "runtime-tokio", "chrono"] }
|
sqlx = { version = "0.8.5", features = ["postgres", "runtime-tokio", "chrono"] }
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
DROP INDEX IF EXISTS movie_sets_year_id_idx;
|
||||||
|
DROP INDEX IF EXISTS movie_sets_year_idx;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- Add index on movie_sets.year to speed up year-based queries
|
||||||
|
CREATE INDEX movie_sets_year_idx ON movie_sets(year);
|
||||||
|
|
||||||
|
-- Composite index for queries that filter by year and return id
|
||||||
|
-- This can make the subquery in UPDATE statements even faster
|
||||||
|
CREATE INDEX movie_sets_year_id_idx ON movie_sets(year, id);
|
||||||
@@ -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 {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ serde = { version = "1.0.219", features = ["derive"] }
|
|||||||
itertools = "0.14.0"
|
itertools = "0.14.0"
|
||||||
serde_json = { version = "1.0.140", features = ["unbounded_depth"] }
|
serde_json = { version = "1.0.140", features = ["unbounded_depth"] }
|
||||||
chrono = "0.4.40"
|
chrono = "0.4.40"
|
||||||
graphql_client = "0.14.0"
|
graphql_client = "0.15.0"
|
||||||
thiserror = "2.0.12"
|
thiserror = "2.0.12"
|
||||||
gloo-net = { version = "0.6.0", features = ["json", "serde_json"] }
|
gloo-net = { version = "0.6.0", features = ["json", "serde_json"] }
|
||||||
human_format = "1.1.0"
|
human_format = "1.1.0"
|
||||||
|
|||||||
@@ -351,8 +351,8 @@ fn search_results(
|
|||||||
attrs! {
|
attrs! {
|
||||||
At::Href => urls::thread(&tid)
|
At::Href => urls::thread(&tid)
|
||||||
},
|
},
|
||||||
div![title_break, &r.subject],
|
div![C!["line-clamp-2"], title_break, &r.subject],
|
||||||
span![C!["text-xs"], pretty_authors(&r.authors)],
|
span![C!["line-clamp-2", "text-xs"], pretty_authors(&r.authors)],
|
||||||
div![
|
div![
|
||||||
C!["flex", "flex-wrap", "justify-between"],
|
C!["flex", "flex-wrap", "justify-between"],
|
||||||
span![tags_chiclet(&tags)],
|
span![tags_chiclet(&tags)],
|
||||||
|
|||||||
Reference in New Issue
Block a user