aboutsummaryrefslogtreecommitdiff
path: root/server/src/ui/assets.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/ui/assets.rs')
-rw-r--r--server/src/ui/assets.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/ui/assets.rs b/server/src/ui/assets.rs
index 63d8525..ecab3d3 100644
--- a/server/src/ui/assets.rs
+++ b/server/src/ui/assets.rs
@@ -4,15 +4,16 @@
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
use super::error::MyResult;
-use crate::{helper::cache::CacheControlFile, logic::session::Session};
+use crate::helper::cache::CacheControlFile;
use anyhow::{anyhow, bail, Context};
use base64::Engine;
use jellybase::{assetfed::AssetInner, database::Database, federation::Federation, CONF};
use jellycache::async_cache_file;
use jellycommon::{LocalTrack, NodeID, PeopleGroup, SourceTrackKind, TrackSource};
+use jellylogic::session::Session;
use log::info;
use rocket::{get, http::ContentType, response::Redirect, State};
-use std::{path::PathBuf, str::FromStr};
+use std::path::PathBuf;
pub const AVIF_QUALITY: f32 = 50.;
pub const AVIF_SPEED: u8 = 5;
@@ -120,7 +121,7 @@ pub async fn r_person_asset(
let node = db.get_node(id)?.ok_or(anyhow!("node does not exist"))?;
let app = node
.people
- .get(&PeopleGroup::from_str(&group).map_err(|()| anyhow!("unknown people group"))?)
+ .get(&PeopleGroup::from_str_opt(&group).ok_or(anyhow!("unknown people group"))?)
.ok_or(anyhow!("group has no members"))?
.get(index)
.ok_or(anyhow!("person does not exist"))?;