From 545e5dd11fefe3467b288b27e291ccf23ce3a92e Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Mon, 27 Jun 2022 19:45:50 +0100 Subject: [PATCH] Fix icon store not being registered --- quickpeep/src/bin/quickpeep.rs | 3 +++ quickpeep/src/config.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/quickpeep/src/bin/quickpeep.rs b/quickpeep/src/bin/quickpeep.rs index 1a19cc9..dc4b6ab 100644 --- a/quickpeep/src/bin/quickpeep.rs +++ b/quickpeep/src/bin/quickpeep.rs @@ -10,6 +10,7 @@ use quickpeep::web::icon_retrieval::retrieve_icon; use quickpeep::web::searcher::{search_root, search_search}; use quickpeep::web::seed_collector::{seed_collection_root, seed_collection_root_post}; use quickpeep::web::IndexAccess; +use quickpeep_index::auxiliary::icon_store::IconStore; use sqlx::sqlite::SqlitePoolOptions; use std::net::SocketAddr; use std::path::PathBuf; @@ -67,6 +68,7 @@ async fn main() -> anyhow::Result<()> { let backend = Arc::new(web_config.open_indexer_backend()?); let index_access = IndexAccess { backend }; + let icon_store = IconStore::open(web_config.index.icon_store.as_path())?; let app = Router::new() .route("/seeds/", get(seed_collection_root)) @@ -77,6 +79,7 @@ async fn main() -> anyhow::Result<()> { .layer(Extension(web_config)) .layer(Extension(pool)) .layer(Extension(index_access)) + .layer(Extension(Arc::new(icon_store))) .nest( "/static", get_service(ServeDir::new("./quickpeep_static/dist")).handle_error( diff --git a/quickpeep/src/config.rs b/quickpeep/src/config.rs index 2dc3674..80b4072 100644 --- a/quickpeep/src/config.rs +++ b/quickpeep/src/config.rs @@ -22,7 +22,7 @@ pub struct WebConfig { #[derive(Debug, Clone, Deserialize)] pub struct IndexConfig { pub backend: BackendConfig, - // TODO icon_store + pub icon_store: PathBuf, } #[derive(Debug, Clone, Deserialize)] @@ -49,6 +49,8 @@ impl WebConfig { BackendConfig::Meili(_) => {} } + web_config.index.icon_store = config_dir.join(web_config.index.icon_store); + Ok(web_config) }