From 2e7b192ce1bee2d5e67624c0f6358fdbcddafa39 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 25 Feb 2025 15:27:44 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/archive/mod.rs | 9 +++++++++ src/main.rs | 9 +++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/archive/mod.rs b/src/archive/mod.rs index d0d3be9..6046881 100644 --- a/src/archive/mod.rs +++ b/src/archive/mod.rs @@ -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) diff --git a/src/main.rs b/src/main.rs index 220c940..5d5ff30 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(), )