Fix icon store not being registered

This commit is contained in:
Olivier 'reivilibre' 2022-06-27 19:45:50 +01:00
parent fda08b20b4
commit 545e5dd11f
2 changed files with 6 additions and 1 deletions

View File

@ -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(

View File

@ -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)
}