♻️ refactor
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2025-02-25 15:27:44 +01:00
parent dc4fb4079e
commit 2e7b192ce1
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 12 additions and 6 deletions

View file

@ -286,6 +286,12 @@ pub async fn index_path(dom: &Domain, path: &str) {
if is_doc {
let doc = dom.path(next_path.path());
log::info!(
"Indexing {} / {} [{} queued]",
doc.domain,
doc.path,
queue.len()
);
index_document(&doc).await;
}
@ -312,6 +318,9 @@ pub async fn index_document(doc: &Document) {
for (mime, data) in extract_data_urls(&String::from_utf8_lossy(&content)) {
let hash = sha256_hash(&data);
println!("{} / {}: Indexing fragment {hash}", doc.domain, doc.path);
hashes.push(hash.clone());
sqlx::query("INSERT INTO fragments (id, mime, blob) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING")
.bind(&hash)

View file

@ -207,12 +207,9 @@ pub fn get_shell() -> Shell {
.push(
Link(
"/mime",
Row(vec![
MaterialIcon("description"),
Text("Media Documents").render(),
])
.full_center()
.gap(ScreenValue::_2),
Row(vec![MaterialIcon("description"), Text("Media").render()])
.full_center()
.gap(ScreenValue::_2),
)
.use_htmx(),
)