diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/lib.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/client/src/lib.rs b/client/src/lib.rs index 61365a3..b80f705 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -5,7 +5,7 @@ */ use anyhow::Result; use jellycommon::user::UserPermission; -use log::debug; +use log::{debug, info}; use reqwest::{ header::{HeaderMap, HeaderValue}, Client, @@ -100,7 +100,10 @@ impl Session { debug!("downloading asset {role:?} for {id:?}"); let mut r = self .client - .get(format!("{}/n/{id}/asset?role={role}&width={width}", self.instance.base())) + .get(format!( + "{}/n/{id}/asset?role={role}&width={width}", + self.instance.base() + )) .send() .await?; while let Some(chunk) = r.chunk().await? { @@ -109,6 +112,17 @@ impl Session { Ok(()) } + pub async fn reimport(&self) -> Result<()> { + // TODO error handling + info!("reimport"); + self.client + .post(format!("{}/admin/import", self.instance.base())) + .send() + .await?; + info!("done"); + Ok(()) + } + pub fn stream(&self, id: &str, stream_spec: &StreamSpec) -> String { format!( "{}/n/{}/stream?{}&{}", |