From 6edf0fd93abf7e58b4c0974e3d3e54bcf8517946 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 8 Dec 2025 19:53:12 +0100 Subject: human-readable cache keys --- logic/src/assets.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'logic/src') diff --git a/logic/src/assets.rs b/logic/src/assets.rs index e5cfada..1862b46 100644 --- a/logic/src/assets.rs +++ b/logic/src/assets.rs @@ -6,9 +6,9 @@ use crate::{DATABASE, session::Session}; use anyhow::{Result, anyhow}; -use jellycommon::{NodeID, Picture, SourceTrackKind, TrackSource}; +use jellycommon::{Asset, NodeID, SourceTrackKind, TrackSource}; -pub async fn get_node_thumbnail(_session: &Session, id: NodeID, t: f64) -> Result { +pub async fn get_node_thumbnail(_session: &Session, id: NodeID, t: f64) -> Result { let node = DATABASE .get_node(id)? .ok_or(anyhow!("node does not exist"))?; @@ -33,8 +33,10 @@ pub async fn get_node_thumbnail(_session: &Session, id: NodeID, t: f64) -> Resul let step = 8.; let t = (t / step).floor() * step; - let asset = match thumb_track_source { - TrackSource::Local(path, _) => jellytranscoder::thumbnail::create_thumbnail(&path, t)?, + Ok(match thumb_track_source { + TrackSource::Local(path, _) => { + Asset(jellytranscoder::thumbnail::create_thumbnail(&path, t)?) + } TrackSource::Remote(_) => { // // TODO in the new system this is preferrably a property of node ext for regular fed // let session = fed @@ -52,7 +54,5 @@ pub async fn get_node_thumbnail(_session: &Session, id: NodeID, t: f64) -> Resul // .await? todo!() } - }; - - Ok(Picture(asset.0)) + }) } -- cgit v1.3