diff --git a/mediarepo-api/src/client_api/file.rs b/mediarepo-api/src/client_api/file.rs index 52033d3..5936527 100644 --- a/mediarepo-api/src/client_api/file.rs +++ b/mediarepo-api/src/client_api/file.rs @@ -39,15 +39,7 @@ impl FileApi { /// Searches for a file by a list of tags #[tracing::instrument(level = "debug", skip(self))] - pub async fn find_files(&self, tags: Vec) -> ApiResult> { - let tags = tags - .into_iter() - .map(|tag| TagQuery { - name: tag, - negate: false, - }) - .collect(); - + pub async fn find_files(&self, tags: Vec) -> ApiResult> { self.emit_and_get("find_files", FindFilesByTagsRequest { tags }) .await } diff --git a/mediarepo-api/src/tauri_plugin/commands/file.rs b/mediarepo-api/src/tauri_plugin/commands/file.rs index 535fc98..c7347e7 100644 --- a/mediarepo-api/src/tauri_plugin/commands/file.rs +++ b/mediarepo-api/src/tauri_plugin/commands/file.rs @@ -1,6 +1,6 @@ use crate::tauri_plugin::commands::{add_once_buffer, ApiAccess, BufferAccess}; use crate::tauri_plugin::error::PluginResult; -use crate::types::files::{FileMetadataResponse, ThumbnailMetadataResponse}; +use crate::types::files::{FileMetadataResponse, TagQuery, ThumbnailMetadataResponse}; #[tauri::command] pub async fn get_all_files(api_state: ApiAccess<'_>) -> PluginResult> { @@ -12,7 +12,7 @@ pub async fn get_all_files(api_state: ApiAccess<'_>) -> PluginResult, + tags: Vec, api_state: ApiAccess<'_>, ) -> PluginResult> { let api = api_state.api().await?;