Change all tags request back to accept content descriptors

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent b315024c6a
commit a78f1bc65d

@ -1,6 +1,6 @@
[package] [package]
name = "mediarepo-api" name = "mediarepo-api"
version = "0.22.0" version = "0.23.0"
edition = "2018" edition = "2018"
license = "gpl-3" license = "gpl-3"

@ -63,10 +63,10 @@ impl TagApi {
/// Returns a list of all tags that are assigned to the list of files /// Returns a list of all tags that are assigned to the list of files
#[tracing::instrument(level = "debug", skip_all)] #[tracing::instrument(level = "debug", skip_all)]
pub async fn get_tags_for_files(&self, ids: Vec<i64>) -> ApiResult<Vec<TagResponse>> { pub async fn get_tags_for_files(&self, cds: Vec<String>) -> ApiResult<Vec<TagResponse>> {
self.emit_and_get( self.emit_and_get(
"tags_for_files", "tags_for_files",
GetFilesTagsRequest { ids }, GetFilesTagsRequest { cds },
Some(Duration::from_secs(10)), Some(Duration::from_secs(10)),
) )
.await .await

@ -32,11 +32,11 @@ pub async fn get_tags_for_file(
#[tauri::command] #[tauri::command]
pub async fn get_tags_for_files( pub async fn get_tags_for_files(
ids: Vec<i64>, cds: Vec<String>,
api_state: ApiAccess<'_>, api_state: ApiAccess<'_>,
) -> PluginResult<Vec<TagResponse>> { ) -> PluginResult<Vec<TagResponse>> {
let api = api_state.api().await?; let api = api_state.api().await?;
let tags = api.tag.get_tags_for_files(ids).await?; let tags = api.tag.get_tags_for_files(cds).await?;
Ok(tags) Ok(tags)
} }

@ -26,7 +26,7 @@ pub struct GetFileTagsRequest {
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GetFilesTagsRequest { pub struct GetFilesTagsRequest {
pub ids: Vec<i64>, pub cds: Vec<String>,
} }
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]

Loading…
Cancel
Save