aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/node.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/routes/ui/node.rs')
-rw-r--r--server/src/routes/ui/node.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/server/src/routes/ui/node.rs b/server/src/routes/ui/node.rs
index 0b53e6d..46ab682 100644
--- a/server/src/routes/ui/node.rs
+++ b/server/src/routes/ui/node.rs
@@ -12,7 +12,6 @@ use crate::{
account::session::Session,
layout::{DynLayoutPage, LayoutPage},
},
- CONF,
};
use anyhow::Context;
use jellycommon::DirectoryKind;
@@ -153,19 +152,7 @@ pub async fn r_item_assets(
let node = library
.nested_path(&path)
.context("retrieving library node")?;
- let path = match role {
- AssetRole::Backdrop => node
- .common()
- .backdrop
- .clone()
- .or_else(|| node.common().poster.clone()),
- AssetRole::Poster => node.common().poster.clone(),
- };
- let path = if let Some(p) = path {
- library.root_path.join(p)
- } else {
- CONF.asset_path.join("fallback.jpeg")
- };
+ let path = node.get_asset(library, role);
info!("loading asset from {path:?}");
Ok((ContentType::WEBP, File::open(path).await?))
}