diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-07 14:08:20 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-07 14:08:20 +0100 |
commit | 346095d20e3d817d150cbea49e87a49fbcaa2304 (patch) | |
tree | 1fc3868fa68287e916e511c8f5b43b62087f0ff9 /client/src/lib.rs | |
parent | 976bdd8e2d14049c766a654a7575f9f5109c7395 (diff) | |
download | jellything-346095d20e3d817d150cbea49e87a49fbcaa2304.tar jellything-346095d20e3d817d150cbea49e87a49fbcaa2304.tar.bz2 jellything-346095d20e3d817d150cbea49e87a49fbcaa2304.tar.zst |
nodeid guard
Diffstat (limited to 'client/src/lib.rs')
-rw-r--r-- | client/src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/src/lib.rs b/client/src/lib.rs index 5da718d..e0ab440 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -71,8 +71,8 @@ impl Session { format!("session={}", self.session_token) } - pub async fn node(&self, id: &str) -> Result<Node> { - debug!("downloading node {id:?}"); + pub async fn node(&self, id: NodeIDOrSlug) -> Result<Node> { + debug!("downloading node {id}"); Ok(self .client .get(format!("{}/n/{id}", self.instance.base())) @@ -86,11 +86,11 @@ impl Session { pub async fn node_thumbnail( &self, writer: impl UnpinWrite, - id: &str, + id: NodeIDOrSlug, width: usize, time: f64, ) -> Result<()> { - debug!("downloading thumbnail for {id:?} at {time}s"); + debug!("downloading thumbnail for {id} at {time}s"); self.download_url( writer, format!( @@ -113,14 +113,14 @@ impl Session { pub async fn stream( &self, writer: impl UnpinWrite, - id: &str, + id: NodeIDOrSlug, stream_spec: &StreamSpec, ) -> Result<()> { self.download_url(writer, self.stream_url(id, stream_spec)) .await } - pub fn stream_url(&self, id: &str, stream_spec: &StreamSpec) -> String { + pub fn stream_url(&self, id: NodeIDOrSlug, stream_spec: &StreamSpec) -> String { format!( "{}/n/{}/stream?{}&{}", self.instance.base(), |