diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-24 18:11:23 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-24 18:47:29 +0100 |
commit | 7323709537c6ff14136cd79fb07606cd79391758 (patch) | |
tree | 3d817d449d4c0a821b9b5073c8acf826c6ccfda1 /client/src | |
parent | cbb2e163abfefd8ed61c41a096d5d6c27b4721b4 (diff) | |
download | jellything-7323709537c6ff14136cd79fb07606cd79391758.tar jellything-7323709537c6ff14136cd79fb07606cd79391758.tar.bz2 jellything-7323709537c6ff14136cd79fb07606cd79391758.tar.zst |
refactor asset system pt. 1
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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, |