This commit is contained in:
parent
dc4fb4079e
commit
2e7b192ce1
2 changed files with 12 additions and 6 deletions
|
@ -286,6 +286,12 @@ pub async fn index_path(dom: &Domain, path: &str) {
|
||||||
|
|
||||||
if is_doc {
|
if is_doc {
|
||||||
let doc = dom.path(next_path.path());
|
let doc = dom.path(next_path.path());
|
||||||
|
log::info!(
|
||||||
|
"Indexing {} / {} [{} queued]",
|
||||||
|
doc.domain,
|
||||||
|
doc.path,
|
||||||
|
queue.len()
|
||||||
|
);
|
||||||
index_document(&doc).await;
|
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)) {
|
for (mime, data) in extract_data_urls(&String::from_utf8_lossy(&content)) {
|
||||||
let hash = sha256_hash(&data);
|
let hash = sha256_hash(&data);
|
||||||
|
|
||||||
|
println!("{} / {}: Indexing fragment {hash}", doc.domain, doc.path);
|
||||||
|
|
||||||
hashes.push(hash.clone());
|
hashes.push(hash.clone());
|
||||||
sqlx::query("INSERT INTO fragments (id, mime, blob) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING")
|
sqlx::query("INSERT INTO fragments (id, mime, blob) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING")
|
||||||
.bind(&hash)
|
.bind(&hash)
|
||||||
|
|
|
@ -207,12 +207,9 @@ pub fn get_shell() -> Shell {
|
||||||
.push(
|
.push(
|
||||||
Link(
|
Link(
|
||||||
"/mime",
|
"/mime",
|
||||||
Row(vec![
|
Row(vec![MaterialIcon("description"), Text("Media").render()])
|
||||||
MaterialIcon("description"),
|
.full_center()
|
||||||
Text("Media Documents").render(),
|
.gap(ScreenValue::_2),
|
||||||
])
|
|
||||||
.full_center()
|
|
||||||
.gap(ScreenValue::_2),
|
|
||||||
)
|
)
|
||||||
.use_htmx(),
|
.use_htmx(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue