From 6929a88c922dc1ec557a1f609284fa13292ff385 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 6 Nov 2021 13:41:30 +0100 Subject: [PATCH] Change update_file_name to expect a metadata response Signed-off-by: trivernis --- mediarepo-api/Cargo.toml | 2 +- mediarepo-api/src/client_api/file.rs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mediarepo-api/Cargo.toml b/mediarepo-api/Cargo.toml index 5ee8df6..9df85dc 100644 --- a/mediarepo-api/Cargo.toml +++ b/mediarepo-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mediarepo-api" -version = "0.4.0" +version = "0.4.1" edition = "2018" license = "gpl-3" diff --git a/mediarepo-api/src/client_api/file.rs b/mediarepo-api/src/client_api/file.rs index 257c634..e3fb0ed 100644 --- a/mediarepo-api/src/client_api/file.rs +++ b/mediarepo-api/src/client_api/file.rs @@ -84,10 +84,12 @@ impl FileApi { /// Updates a files name #[tracing::instrument(level = "debug", skip(self))] - pub async fn update_file_name(&self, file_id: FileIdentifier, name: String) -> ApiResult<()> { - self.emit("update_file_name", UpdateFileNameRequest { file_id, name }) - .await?; - - Ok(()) + pub async fn update_file_name( + &self, + file_id: FileIdentifier, + name: String, + ) -> ApiResult { + self.emit_and_get("update_file_name", UpdateFileNameRequest { file_id, name }) + .await } }