Compare commits

...

39 Commits

Author SHA1 Message Date
7de6a5f0fc chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 2m12s
Continuous integration / Test Suite (push) Successful in 2m25s
Continuous integration / Trunk (push) Successful in 2m10s
Continuous integration / Rustfmt (push) Successful in 49s
Continuous integration / Disallow unused dependencies (push) Successful in 2m39s
Continuous integration / build (push) Successful in 4m35s
2026-01-14 13:37:20 -08:00
83230ba962 Merge branch 'renovate/lock-file-maintenance'
Some checks failed
Continuous integration / Test Suite (push) Successful in 3m47s
Continuous integration / Check (push) Successful in 5m46s
Continuous integration / Trunk (push) Successful in 2m12s
Continuous integration / Rustfmt (push) Successful in 1m38s
Continuous integration / build (push) Successful in 4m32s
Continuous integration / Disallow unused dependencies (push) Has been cancelled
2026-01-14 13:27:00 -08:00
6ef786c4e7 Manually update deps to a buildable rev 2026-01-14 13:26:30 -08:00
d4c29d7b98 chore(deps): lock file maintenance
Some checks failed
Continuous integration / Check (push) Failing after 1m34s
Continuous integration / Test Suite (push) Failing after 3m56s
Continuous integration / Rustfmt (push) Successful in 45s
Continuous integration / build (push) Failing after 3m11s
Continuous integration / Disallow unused dependencies (push) Failing after 3m7s
Continuous integration / Trunk (push) Successful in 21m26s
2026-01-14 18:31:51 +00:00
95a4f2e630 Merge pull request 'chore(deps): update all non-major dependencies' (#227) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m38s
Continuous integration / Trunk (push) Successful in 1m53s
Continuous integration / Rustfmt (push) Successful in 53s
Continuous integration / Test Suite (push) Successful in 4m26s
Continuous integration / build (push) Successful in 2m20s
Continuous integration / Disallow unused dependencies (push) Successful in 5m42s
2026-01-14 10:31:19 -08:00
faa35dd65a chore(deps): update all non-major dependencies
All checks were successful
Continuous integration / Test Suite (push) Successful in 2m36s
Continuous integration / Check (push) Successful in 2m44s
Continuous integration / Trunk (push) Successful in 1m27s
Continuous integration / Rustfmt (push) Successful in 1m36s
Continuous integration / build (push) Successful in 2m48s
Continuous integration / Disallow unused dependencies (push) Successful in 5m37s
2026-01-14 13:16:29 +00:00
7c54c6b9c3 Merge pull request 'fix(deps): update rust crate quick-xml to 0.39.0' (#225) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Test Suite (push) Successful in 2m29s
Continuous integration / Check (push) Successful in 2m38s
Continuous integration / Trunk (push) Successful in 1m19s
Continuous integration / Rustfmt (push) Successful in 1m40s
Continuous integration / build (push) Successful in 2m16s
Continuous integration / Disallow unused dependencies (push) Successful in 5m35s
2026-01-11 11:31:18 -08:00
2d1e38bdff fix(deps): update rust crate quick-xml to 0.39.0
All checks were successful
Continuous integration / Check (push) Successful in 2m33s
Continuous integration / Test Suite (push) Successful in 4m6s
Continuous integration / Rustfmt (push) Successful in 1m38s
Continuous integration / build (push) Successful in 4m17s
Continuous integration / Trunk (push) Successful in 7m52s
Continuous integration / Disallow unused dependencies (push) Successful in 5m40s
2026-01-11 19:01:21 +00:00
33bb355975 chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 1m48s
Continuous integration / Test Suite (push) Successful in 2m4s
Continuous integration / Rustfmt (push) Successful in 58s
Continuous integration / Trunk (push) Successful in 2m11s
Continuous integration / build (push) Successful in 3m33s
Continuous integration / Disallow unused dependencies (push) Successful in 5m42s
2026-01-08 16:13:19 -08:00
2f20a3a8ed server: set user-agent when slurping, fixes /. bug 2026-01-08 16:13:00 -08:00
8b3bfe253f Merge pull request 'chore(deps): update actions/checkout action to v6' (#197) from renovate/actions-checkout-6.x into master
All checks were successful
Continuous integration / Check (push) Successful in 3m43s
Continuous integration / Test Suite (push) Successful in 3m52s
Continuous integration / Rustfmt (push) Successful in 46s
Continuous integration / Trunk (push) Successful in 2m27s
Continuous integration / build (push) Successful in 2m20s
Continuous integration / Disallow unused dependencies (push) Successful in 5m39s
Reviewed-on: #197
2026-01-08 12:23:57 -08:00
22b9646ac4 Merge pull request 'fix(deps): update rust crate zip to v7' (#217) from renovate/zip-7.x into master
Some checks failed
Continuous integration / Check (push) Has been cancelled
Continuous integration / Test Suite (push) Has been cancelled
Continuous integration / Trunk (push) Has been cancelled
Continuous integration / Rustfmt (push) Has been cancelled
Continuous integration / build (push) Has been cancelled
Continuous integration / Disallow unused dependencies (push) Has been cancelled
Reviewed-on: #217
2026-01-08 12:23:42 -08:00
1df8ad8a0c Merge branch 'renovate/all-minor-patch'
All checks were successful
Continuous integration / Check (push) Successful in 1m26s
Continuous integration / Trunk (push) Successful in 59s
Continuous integration / Rustfmt (push) Successful in 49s
Continuous integration / Test Suite (push) Successful in 4m6s
Continuous integration / build (push) Successful in 2m43s
Continuous integration / Disallow unused dependencies (push) Successful in 5m49s
2026-01-08 10:51:25 -08:00
bb7721dbc6 Updates for askama 2026-01-08 10:51:09 -08:00
475c552e3a fix(deps): update all non-major dependencies
Some checks failed
Continuous integration / Check (push) Failing after 1m54s
Continuous integration / Trunk (push) Successful in 1m34s
Continuous integration / Rustfmt (push) Successful in 45s
Continuous integration / Test Suite (push) Failing after 5m28s
Continuous integration / build (push) Failing after 3m29s
Continuous integration / Disallow unused dependencies (push) Failing after 5m41s
2026-01-08 17:03:02 +00:00
c85832c93b chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 1m28s
Continuous integration / Test Suite (push) Successful in 2m30s
Continuous integration / Rustfmt (push) Successful in 1m4s
Continuous integration / Trunk (push) Successful in 2m5s
Continuous integration / build (push) Successful in 2m24s
Continuous integration / Disallow unused dependencies (push) Successful in 5m0s
2026-01-08 08:54:01 -08:00
7e991186fe server: add indexes that should help with bulk read 2026-01-08 08:53:42 -08:00
95d06ec669 Merge pull request 'chore(deps): lock file maintenance' (#224) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m18s
Continuous integration / Test Suite (push) Successful in 4m27s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / Trunk (push) Successful in 3m56s
Continuous integration / build (push) Successful in 1m56s
Continuous integration / Disallow unused dependencies (push) Successful in 5m9s
2026-01-04 16:32:18 -08:00
84810d8644 chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 2m19s
Continuous integration / Trunk (push) Successful in 1m37s
Continuous integration / Rustfmt (push) Successful in 46s
Continuous integration / build (push) Successful in 4m33s
Continuous integration / Test Suite (push) Successful in 9m6s
Continuous integration / Disallow unused dependencies (push) Successful in 2m21s
2026-01-05 00:02:23 +00:00
8a86f0d0b2 chore: Release
All checks were successful
Continuous integration / Check (push) Successful in 1m8s
Continuous integration / Test Suite (push) Successful in 3m35s
Continuous integration / Rustfmt (push) Successful in 55s
Continuous integration / Trunk (push) Successful in 2m4s
Continuous integration / build (push) Successful in 1m51s
Continuous integration / Disallow unused dependencies (push) Successful in 5m1s
2026-01-04 11:08:22 -08:00
eab4986fd3 server: fix date extraction and unit tests 2026-01-04 11:08:03 -08:00
3c644c570e Merge pull request 'chore(deps): lock file maintenance' (#223) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m25s
Continuous integration / Test Suite (push) Successful in 2m17s
Continuous integration / Trunk (push) Successful in 2m5s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / Disallow unused dependencies (push) Successful in 2m26s
Continuous integration / build (push) Successful in 9m7s
2025-12-28 18:46:57 -08:00
7a9df3c15c chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 2m28s
Continuous integration / Test Suite (push) Successful in 2m42s
Continuous integration / Rustfmt (push) Successful in 42s
Continuous integration / build (push) Successful in 2m41s
Continuous integration / Disallow unused dependencies (push) Successful in 2m14s
Continuous integration / Trunk (push) Successful in 20m53s
2025-12-29 01:47:41 +00:00
f9d8acf744 Merge pull request 'chore(deps): lock file maintenance' (#222) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 2m14s
Continuous integration / Test Suite (push) Successful in 1m51s
Continuous integration / Rustfmt (push) Successful in 1m2s
Continuous integration / Trunk (push) Successful in 2m7s
Continuous integration / build (push) Successful in 2m7s
Continuous integration / Disallow unused dependencies (push) Successful in 5m4s
2025-12-28 16:48:08 -08:00
75f3770f3e chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 4m26s
Continuous integration / Test Suite (push) Successful in 4m25s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 4m10s
Continuous integration / Disallow unused dependencies (push) Successful in 2m18s
Continuous integration / Trunk (push) Successful in 20m54s
2025-12-29 00:02:21 +00:00
85dd61a272 Merge pull request 'chore(deps): update rust crate serde_json to v1.0.146' (#220) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 1m29s
Continuous integration / Test Suite (push) Successful in 6m57s
Continuous integration / Trunk (push) Successful in 7m51s
Continuous integration / Rustfmt (push) Successful in 1m30s
Continuous integration / build (push) Successful in 2m18s
Continuous integration / Disallow unused dependencies (push) Successful in 5m1s
2025-12-22 05:01:52 -08:00
1c5412de14 chore(deps): update rust crate serde_json to v1.0.146
All checks were successful
Continuous integration / Check (push) Successful in 2m41s
Continuous integration / Test Suite (push) Successful in 2m46s
Continuous integration / Rustfmt (push) Successful in 54s
Continuous integration / build (push) Successful in 2m51s
Continuous integration / Disallow unused dependencies (push) Successful in 2m16s
Continuous integration / Trunk (push) Successful in 21m20s
2025-12-22 12:31:26 +00:00
034027ddd5 Merge pull request 'chore(deps): lock file maintenance' (#219) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 1m39s
Continuous integration / Test Suite (push) Successful in 2m37s
Continuous integration / Trunk (push) Successful in 2m5s
Continuous integration / Rustfmt (push) Successful in 53s
Continuous integration / Disallow unused dependencies (push) Successful in 2m30s
Continuous integration / build (push) Successful in 7m6s
2025-12-21 16:47:07 -08:00
81a07a8172 chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 3m28s
Continuous integration / Test Suite (push) Successful in 3m40s
Continuous integration / Rustfmt (push) Successful in 47s
Continuous integration / build (push) Successful in 3m30s
Continuous integration / Disallow unused dependencies (push) Successful in 2m22s
Continuous integration / Trunk (push) Successful in 21m0s
2025-12-22 00:02:30 +00:00
d9e8c2133e Merge pull request 'chore(deps): update rust crate axum to v0.8.8' (#218) from renovate/axum-monorepo into master
All checks were successful
Continuous integration / Check (push) Successful in 1m10s
Continuous integration / Trunk (push) Successful in 1m12s
Continuous integration / Rustfmt (push) Successful in 50s
Continuous integration / Test Suite (push) Successful in 3m2s
Continuous integration / build (push) Successful in 1m54s
Continuous integration / Disallow unused dependencies (push) Successful in 5m0s
2025-12-20 09:02:03 -08:00
99aa7a7071 chore(deps): update rust crate axum to v0.8.8
All checks were successful
Continuous integration / Check (push) Successful in 1m11s
Continuous integration / Test Suite (push) Successful in 3m36s
Continuous integration / Rustfmt (push) Successful in 1m30s
Continuous integration / build (push) Successful in 4m12s
Continuous integration / Trunk (push) Successful in 8m35s
Continuous integration / Disallow unused dependencies (push) Successful in 5m2s
2025-12-20 16:46:32 +00:00
bf7418339e fix(deps): update rust crate zip to v7
All checks were successful
Continuous integration / Check (push) Successful in 1m36s
Continuous integration / Test Suite (push) Successful in 2m46s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 2m46s
Continuous integration / Disallow unused dependencies (push) Successful in 2m19s
Continuous integration / Trunk (push) Successful in 21m7s
2025-12-20 00:01:57 +00:00
cc585cc63f Merge pull request 'chore(deps): lock file maintenance' (#214) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 55s
Continuous integration / Test Suite (push) Successful in 1m17s
Continuous integration / Trunk (push) Successful in 1m3s
Continuous integration / Rustfmt (push) Successful in 1m29s
Continuous integration / build (push) Successful in 1m28s
Continuous integration / Disallow unused dependencies (push) Successful in 5m3s
2025-12-15 09:47:04 -08:00
293f90fde5 chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 1m3s
Continuous integration / Test Suite (push) Successful in 1m38s
Continuous integration / Trunk (push) Successful in 1m13s
Continuous integration / Rustfmt (push) Successful in 41s
Continuous integration / build (push) Successful in 1m36s
Continuous integration / Disallow unused dependencies (push) Successful in 2m17s
2025-12-15 17:17:40 +00:00
a06e4b3454 Merge pull request 'chore(deps): update rust crate reqwest to v0.12.26' (#215) from renovate/all-minor-patch into master
All checks were successful
Continuous integration / Check (push) Successful in 56s
Continuous integration / Test Suite (push) Successful in 1m22s
Continuous integration / Rustfmt (push) Successful in 40s
Continuous integration / build (push) Successful in 1m36s
Continuous integration / Disallow unused dependencies (push) Successful in 2m27s
Continuous integration / Trunk (push) Successful in 21m2s
2025-12-15 09:16:55 -08:00
6e5145e21b chore(deps): update rust crate reqwest to v0.12.26
All checks were successful
Continuous integration / Check (push) Successful in 56s
Continuous integration / Test Suite (push) Successful in 1m38s
Continuous integration / Trunk (push) Successful in 1m5s
Continuous integration / Rustfmt (push) Successful in 1m30s
Continuous integration / build (push) Successful in 2m18s
Continuous integration / Disallow unused dependencies (push) Successful in 5m6s
2025-12-15 16:46:42 +00:00
d41f3e9fd1 Merge pull request 'chore(deps): lock file maintenance' (#213) from renovate/lock-file-maintenance into master
All checks were successful
Continuous integration / Check (push) Successful in 58s
Continuous integration / Test Suite (push) Successful in 1m37s
Continuous integration / Rustfmt (push) Successful in 54s
Continuous integration / Trunk (push) Successful in 2m3s
Continuous integration / build (push) Successful in 1m42s
Continuous integration / Disallow unused dependencies (push) Successful in 5m4s
2025-12-14 16:47:42 -08:00
5519018043 chore(deps): lock file maintenance
All checks were successful
Continuous integration / Check (push) Successful in 1m15s
Continuous integration / Test Suite (push) Successful in 2m23s
Continuous integration / Rustfmt (push) Successful in 1m16s
Continuous integration / build (push) Successful in 2m42s
Continuous integration / Disallow unused dependencies (push) Successful in 2m24s
Continuous integration / Trunk (push) Successful in 21m15s
2025-12-15 00:02:24 +00:00
51ff0b8e14 chore(deps): update actions/checkout action to v6
All checks were successful
Continuous integration / Check (push) Successful in 58s
Continuous integration / Test Suite (push) Successful in 1m51s
Continuous integration / Rustfmt (push) Successful in 41s
Continuous integration / build (push) Successful in 1m53s
Continuous integration / Disallow unused dependencies (push) Successful in 2m19s
Continuous integration / Trunk (push) Successful in 1m41s
2025-11-20 16:46:50 +00:00
8 changed files with 737 additions and 493 deletions

View File

@@ -7,7 +7,7 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo check
@@ -15,7 +15,7 @@ jobs:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test
@@ -23,7 +23,7 @@ jobs:
name: Trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
@@ -35,7 +35,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
@@ -46,7 +46,7 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo build
@@ -54,7 +54,7 @@ jobs:
name: Disallow unused dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly

1168
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
edition = "2021"
license = "UNLICENSED"
publish = ["xinu"]
version = "0.17.55"
version = "0.17.59"
repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev]

View File

@@ -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"
@@ -39,9 +39,9 @@ lol_html = "2.3.0"
mailparse = "0.16.1"
maplit = "1.0.2"
memmap = "0.7.0"
quick-xml = { version = "0.38.1", features = ["serialize"] }
quick-xml = { version = "0.39.0", 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"
@@ -56,7 +56,7 @@ urlencoding = "2.1.3"
#xtracing = { git = "http://git-private.h.xinu.tv/wathiede/xtracing.git" }
#xtracing = { path = "../../xtracing" }
xtracing = { version = "0.3.2", registry = "xinu" }
zip = "6.0.0"
zip = "7.0.0"
[build-dependencies]

View File

@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS movie_sets_year_id_idx;
DROP INDEX IF EXISTS movie_sets_year_idx;

View File

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

View File

@@ -34,6 +34,7 @@ const TEXT_PLAIN: &'static str = "text/plain";
// Inline Askama filters module for template use
mod filters {
// Usage: {{ items|batch(7) }}
#[askama::filter_fn]
pub fn batch<T: Clone>(
items: &[T],
_: &dyn ::askama::Values,
@@ -195,8 +196,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 +2316,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 +2417,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 +2451,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 {

View File

@@ -44,6 +44,8 @@ use crate::{
const NEWSREADER_TAG_PREFIX: &'static str = "News/";
const NEWSREADER_THREAD_PREFIX: &'static str = "news:";
const USER_AGENT: &'static str = "letterbox news reader (letterbox-ua@xinu.tv)";
// TODO: figure out how to use Cow
#[async_trait]
trait Transformer: Send + Sync {
@@ -318,7 +320,8 @@ impl<'c> Transformer for SlurpContents<'c> {
let body = if let Some(body) = cacher.get(link.as_str()) {
String::from_utf8_lossy(&body).to_string()
} else {
let resp = reqwest::get(link.as_str()).await?;
let client = reqwest::Client::builder().user_agent(USER_AGENT).build()?;
let resp = client.get(link.as_str()).send().await?;
let status = resp.status();
if status.is_server_error() {
error!("status error for {link}: {status}");