From 7323709537c6ff14136cd79fb07606cd79391758 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 24 Jan 2024 18:11:23 +0100 Subject: refactor asset system pt. 1 --- client/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'client/src') diff --git a/client/src/lib.rs b/client/src/lib.rs index 2af230f..c770a83 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -131,6 +131,15 @@ impl Session { .await } + pub async fn asset(&self, writer: impl UnpinWrite, token: &str, width: usize) -> Result<()> { + debug!("downloading asset {token:?} (w={width})"); + self.download_url( + writer, + format!("{}/asset/{token}?width={width}", self.instance.base(),), + ) + .await + } + pub async fn stream( &self, writer: impl UnpinWrite, -- cgit v1.2.3-70-g09d2