aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cache/user.rs1
-rw-r--r--src/config.rs4
-rw-r--r--src/ctx.rs5
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cache/user.rs b/src/cache/user.rs
index 253773c..e228cc2 100644
--- a/src/cache/user.rs
+++ b/src/cache/user.rs
@@ -10,6 +10,7 @@ use super::{CacheFuture, CacheGetter, Cache, AsyncCache};
use crate::deserialize::{User, Track, TrackStub};
use crate::CONFIG;
+pub type UserInfo = Arc<(User, Track, TrackStub)>;
type UserFuture = CacheFuture<Arc<(User, Track, TrackStub)>>;
type UserGetter = CacheGetter<Arc<(User, Track, TrackStub)>>;
type UserCache = Cache<Arc<(User, Track, TrackStub)>>;
diff --git a/src/config.rs b/src/config.rs
index 1a192b2..350786d 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -50,8 +50,8 @@ impl Config {
allowlist: var("LFME_WHITELIST").or_else(|_| var("LFME_ALLOWLIST")).ok().map(|w| w.split(',').map(|s| s.trim().to_string()).collect()).unwrap_or_default(),
allowlist_mode: var("LFME_WHITELIST_MODE").or_else(|_| var("LFME_ALLOWLIST_MODE")).map(|m| m.to_ascii_lowercase()).unwrap_or_else(|_| "open".into()),
- default_refresh: default_refresh,
- allowlist_refresh: allowlist_refresh
+ default_refresh,
+ allowlist_refresh
})
}
diff --git a/src/ctx.rs b/src/ctx.rs
index 6d0118e..3d14e4c 100644
--- a/src/ctx.rs
+++ b/src/ctx.rs
@@ -1,10 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-only
-use std::sync::Arc;
use std::collections::BTreeMap;
use reqwest::StatusCode;
-use super::deserialize as de;
+use super::cache::user::UserInfo;
use super::config::CONFIG;
use crate::cache::font::FontQuery;
@@ -107,7 +106,7 @@ pub mod model {
}
pub use model::Root as Ctx;
-pub async fn get_ctx(api_result: Result<Arc<(de::User, de::Track, de::TrackStub)>, (StatusCode, &'static str)>, font_query: Option<FontQuery>, query: BTreeMap<String, String>) -> (Ctx, StatusCode) {
+pub async fn get_ctx(api_result: Result<UserInfo, (StatusCode, &'static str)>, font_query: Option<FontQuery>, query: BTreeMap<String, String>) -> (Ctx, StatusCode) {
match api_result {
Ok(a) => {
let (user, track, trackstub) = a.as_ref();