aboutsummaryrefslogtreecommitdiff
path: root/logic
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-05-04 15:11:11 +0200
committermetamuffin <metamuffin@disroot.org>2025-05-04 15:11:11 +0200
commit3cbe45e24355396645b9a721fdca6d5116bd1c36 (patch)
treeecc5e61167c47362c49375e542bf6752aad12b09 /logic
parent0a5c23757c2a0fc8784ea1b5a3ad5b0cba0709e0 (diff)
downloadjellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar
jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.bz2
jellything-3cbe45e24355396645b9a721fdca6d5116bd1c36.tar.zst
fix live log
Diffstat (limited to 'logic')
-rw-r--r--logic/Cargo.toml1
-rw-r--r--logic/src/admin/log.rs4
-rw-r--r--logic/src/admin/mod.rs14
3 files changed, 16 insertions, 3 deletions
diff --git a/logic/Cargo.toml b/logic/Cargo.toml
index 23016f9..fd70b73 100644
--- a/logic/Cargo.toml
+++ b/logic/Cargo.toml
@@ -5,6 +5,7 @@ edition = "2024"
[dependencies]
jellyimport-asset-token = { path = "../import/asset_token" }
+jellyimport = { path = "../import" }
jellycommon = { path = "../common" }
jellydb = { path = "../database" }
log = "0.4.27"
diff --git a/logic/src/admin/log.rs b/logic/src/admin/log.rs
index 64d23ca..7130c45 100644
--- a/logic/src/admin/log.rs
+++ b/logic/src/admin/log.rs
@@ -44,9 +44,9 @@ pub fn get_log_buffer(warn: bool) -> VecDeque<Arc<LogLine>> {
}
pub fn get_log_stream(warn: bool) -> broadcast::Receiver<Arc<LogLine>> {
if warn {
- LOGGER.stream.0.subscribe()
- } else {
LOGGER.stream.1.subscribe()
+ } else {
+ LOGGER.stream.0.subscribe()
}
}
diff --git a/logic/src/admin/mod.rs b/logic/src/admin/mod.rs
index 270a732..2545ba4 100644
--- a/logic/src/admin/mod.rs
+++ b/logic/src/admin/mod.rs
@@ -4,5 +4,17 @@
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
-pub mod user;
pub mod log;
+pub mod user;
+
+use crate::session::AdminSession;
+use anyhow::Result;
+use jellydb::Database;
+use jellyimport::IMPORT_ERRORS;
+
+pub async fn get_import_errors(_session: &AdminSession) -> Vec<String> {
+ IMPORT_ERRORS.read().await.to_owned()
+}
+pub fn list_invites(_session: &AdminSession, database: &Database) -> Result<Vec<String>> {
+ database.list_invites()
+}