From 439f184ac655eb649f056cdf0b9326dcc0af4648 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 18 May 2025 14:32:55 +0200 Subject: webui ws --- src/api.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/api.rs (limited to 'src/api.rs') diff --git a/src/api.rs b/src/api.rs new file mode 100644 index 0000000..4fd3888 --- /dev/null +++ b/src/api.rs @@ -0,0 +1,14 @@ +use crate::State; +use axum::{Json, extract::State as S}; +use std::{collections::HashSet, sync::Arc}; +use tokio::sync::RwLock; + +pub async fn api_queue_json(S(state): S>>) -> Json> { + Json(state.read().await.queue.clone()) +} +pub async fn api_loading_json(S(state): S>>) -> Json> { + Json(state.read().await.loading.clone()) +} +pub async fn api_complete_json(S(state): S>>) -> Json> { + Json(state.read().await.complete.clone()) +} -- cgit v1.2.3-70-g09d2