Compare commits
3 Commits
80454cbc7e
...
2008457911
| Author | SHA1 | Date | |
|---|---|---|---|
| 2008457911 | |||
| f6b57e63fd | |||
| d681612e8e |
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -2910,7 +2910,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox"
|
name = "letterbox"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"build-info-build",
|
"build-info-build",
|
||||||
@ -2936,7 +2936,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox-server"
|
name = "letterbox-server"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@ -3457,7 +3457,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "notmuch"
|
name = "notmuch"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools 0.10.5",
|
"itertools 0.10.5",
|
||||||
"log",
|
"log",
|
||||||
@ -4252,7 +4252,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "procmail2notmuch"
|
name = "procmail2notmuch"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
]
|
]
|
||||||
@ -5331,7 +5331,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shared"
|
name = "shared"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"notmuch",
|
"notmuch",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "notmuch"
|
name = "notmuch"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "procmail2notmuch"
|
name = "procmail2notmuch"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"db_name": "PostgreSQL",
|
"db_name": "PostgreSQL",
|
||||||
"query": "SELECT\n p.id,\n link,\n clean_summary\nFROM\n-- Remoe tablesample when db sufficiently indexed\n post AS p TABLESAMPLE SYSTEM (.1)\nINNER JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts\nWHERE search_summary IS NULL;\n",
|
"query": "SELECT\n p.id,\n link,\n clean_summary\nFROM\n post AS p\nINNER JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts\nWHERE search_summary IS NULL;\n",
|
||||||
"describe": {
|
"describe": {
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
@ -28,5 +28,5 @@
|
|||||||
true
|
true
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"hash": "26e150d5d294f2eb264bbae21766295c4e4e5fe1e076dd7d6bc168e5fb49dc84"
|
"hash": "3900728293604ff2c174c208386699b1898f9e74447963b931c7ba1c94d75b7b"
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "letterbox-server"
|
name = "letterbox-server"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "letterbox-server"
|
default-run = "letterbox-server"
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ SELECT
|
|||||||
link,
|
link,
|
||||||
clean_summary
|
clean_summary
|
||||||
FROM
|
FROM
|
||||||
-- Remoe tablesample when db sufficiently indexed
|
post AS p
|
||||||
post AS p TABLESAMPLE SYSTEM (.1)
|
|
||||||
INNER JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts
|
INNER JOIN feed AS f ON p.site = f.slug -- necessary to weed out nzb posts
|
||||||
WHERE search_summary IS NULL;
|
WHERE search_summary IS NULL;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ use async_trait::async_trait;
|
|||||||
use cacher::{Cacher, FilesystemCacher};
|
use cacher::{Cacher, FilesystemCacher};
|
||||||
use css_inline::{CSSInliner, InlineError, InlineOptions};
|
use css_inline::{CSSInliner, InlineError, InlineOptions};
|
||||||
use linkify::{LinkFinder, LinkKind};
|
use linkify::{LinkFinder, LinkKind};
|
||||||
use log::{error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use lol_html::{
|
use lol_html::{
|
||||||
element, errors::RewritingError, html_content::ContentType, rewrite_str, text,
|
element, errors::RewritingError, html_content::ContentType, rewrite_str, text,
|
||||||
RewriteStrSettings,
|
RewriteStrSettings,
|
||||||
@ -23,7 +23,6 @@ use regex::Regex;
|
|||||||
use scraper::{Html, Selector};
|
use scraper::{Html, Selector};
|
||||||
use sqlx::types::time::PrimitiveDateTime;
|
use sqlx::types::time::PrimitiveDateTime;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::sync::Mutex;
|
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -288,6 +287,7 @@ impl<'c> Transformer for SlurpContents<'c> {
|
|||||||
// configuration found for this site, use the local InlineStyle
|
// configuration found for this site, use the local InlineStyle
|
||||||
// transform.
|
// transform.
|
||||||
if self.inline_css && self.get_selectors(test_link).is_none() {
|
if self.inline_css && self.get_selectors(test_link).is_none() {
|
||||||
|
debug!("local inline CSS for {link:?}");
|
||||||
return InlineStyle {}.transform(link, html).await;
|
return InlineStyle {}.transform(link, html).await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -308,6 +308,7 @@ impl<'c> Transformer for SlurpContents<'c> {
|
|||||||
let body = Arc::new(body);
|
let body = Arc::new(body);
|
||||||
let base_url = Some(link.clone());
|
let base_url = Some(link.clone());
|
||||||
let body = if self.inline_css {
|
let body = if self.inline_css {
|
||||||
|
debug!("inlining CSS for {link}");
|
||||||
let inner_body = Arc::clone(&body);
|
let inner_body = Arc::clone(&body);
|
||||||
let res = tokio::task::spawn_blocking(move || {
|
let res = tokio::task::spawn_blocking(move || {
|
||||||
let css = concat!(
|
let css = concat!(
|
||||||
@ -341,6 +342,7 @@ impl<'c> Transformer for SlurpContents<'c> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
debug!("using body as-is for {link:?}");
|
||||||
Arc::into_inner(body).expect("failed to take body out of Arc")
|
Arc::into_inner(body).expect("failed to take body out of Arc")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "shared"
|
name = "shared"
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
version = "0.0.122"
|
version = "0.0.123"
|
||||||
name = "letterbox"
|
name = "letterbox"
|
||||||
repository = "https://github.com/seed-rs/seed-quickstart"
|
repository = "https://github.com/seed-rs/seed-quickstart"
|
||||||
authors = ["Bill Thiede <git@xinu.tv>"]
|
authors = ["Bill Thiede <git@xinu.tv>"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user