aboutsummaryrefslogtreecommitdiff
path: root/logic
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-12-08 19:53:12 +0100
committermetamuffin <metamuffin@disroot.org>2025-12-08 19:53:12 +0100
commit6edf0fd93abf7e58b4c0974e3d3e54bcf8517946 (patch)
tree32577db9d987897d4037ba9af0084b95b55e145c /logic
parente4584a8135584e6591bac7d5397cf227cf3cff92 (diff)
downloadjellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar
jellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar.bz2
jellything-6edf0fd93abf7e58b4c0974e3d3e54bcf8517946.tar.zst
human-readable cache keys
Diffstat (limited to 'logic')
-rw-r--r--logic/src/assets.rs14
1 files changed, 7 insertions, 7 deletions
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<Picture> {
+pub async fn get_node_thumbnail(_session: &Session, id: NodeID, t: f64) -> Result<Asset> {
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))
+ })
}