2022-12-08 02:30:10 +00:00
|
|
|
use decky_api::StorePluginList;
|
|
|
|
|
2022-12-10 02:10:14 +00:00
|
|
|
use actix_web::{get, web, Responder};
|
|
|
|
|
|
|
|
use crate::storage::IStorage;
|
2022-12-08 02:30:10 +00:00
|
|
|
|
|
|
|
#[get("/plugins")]
|
2023-12-31 01:43:05 +00:00
|
|
|
pub async fn decky_plugins(req: actix_web::HttpRequest, data: actix_web::web::Data<Box<dyn IStorage>>) -> impl Responder {
|
|
|
|
let query_string = req.query_string().to_owned();
|
|
|
|
log::debug!("Got request with uri {}", req.uri());
|
|
|
|
let plugins: StorePluginList = web::block(move || data.plugins(&query_string)).await.unwrap();
|
|
|
|
log::debug!("Got {} plugin results", plugins.len());
|
2022-12-10 02:10:14 +00:00
|
|
|
web::Json(plugins)
|
2022-12-08 02:30:10 +00:00
|
|
|
}
|