From 209bc8a9d0068d4569f068beee1bee7827012019 Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 4 Nov 2021 20:29:40 +0100 Subject: [PATCH] Add tauri command to get all tags for a list of files Signed-off-by: trivernis --- mediarepo-api/src/tauri_plugin/commands/tag.rs | 11 +++++++++++ mediarepo-api/src/tauri_plugin/mod.rs | 1 + 2 files changed, 12 insertions(+) diff --git a/mediarepo-api/src/tauri_plugin/commands/tag.rs b/mediarepo-api/src/tauri_plugin/commands/tag.rs index 6a9b11c..a9e2426 100644 --- a/mediarepo-api/src/tauri_plugin/commands/tag.rs +++ b/mediarepo-api/src/tauri_plugin/commands/tag.rs @@ -20,3 +20,14 @@ pub async fn get_tags_for_file( Ok(tags) } + +#[tauri::command] +pub async fn get_tags_for_files( + hashes: Vec, + api_state: ApiAccess<'_>, +) -> PluginResult> { + let api = api_state.api().await?; + let tags = api.tag.get_tags_for_files(hashes).await?; + + Ok(tags) +} diff --git a/mediarepo-api/src/tauri_plugin/mod.rs b/mediarepo-api/src/tauri_plugin/mod.rs index f3848e8..ac031fd 100644 --- a/mediarepo-api/src/tauri_plugin/mod.rs +++ b/mediarepo-api/src/tauri_plugin/mod.rs @@ -37,6 +37,7 @@ impl MediarepoPlugin { get_repositories, get_all_tags, get_tags_for_file, + get_tags_for_files, get_active_repository, add_repository, select_repository,