chore: bump deps; fix clippy lints & cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4c4815ad145650a07f108614034d2e996a6a6964
This commit is contained in:
parent
c535650f45
commit
cd1161ee5d
41 changed files with 1528 additions and 953 deletions
|
|
@ -2,6 +2,19 @@ use uuid::Uuid;
|
|||
|
||||
use crate::{error::Result, model::*, storage::DynStorageBackend};
|
||||
|
||||
/// Creates a new collection.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `storage` - Storage backend
|
||||
/// * `name` - Collection name
|
||||
/// * `kind` - Manual or virtual collection
|
||||
/// * `description` - Optional description
|
||||
/// * `filter_query` - For virtual collections, the search query
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// The created collection
|
||||
pub async fn create_collection(
|
||||
storage: &DynStorageBackend,
|
||||
name: &str,
|
||||
|
|
@ -14,6 +27,18 @@ pub async fn create_collection(
|
|||
.await
|
||||
}
|
||||
|
||||
/// Adds a media item to a collection.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `storage` - Storage backend
|
||||
/// * `collection_id` - Target collection
|
||||
/// * `media_id` - Media item to add
|
||||
/// * `position` - Position in the collection order
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// `Ok(())` on success
|
||||
pub async fn add_member(
|
||||
storage: &DynStorageBackend,
|
||||
collection_id: Uuid,
|
||||
|
|
@ -32,6 +57,17 @@ pub async fn add_member(
|
|||
.await
|
||||
}
|
||||
|
||||
/// Removes a media item from a collection.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `storage` - Storage backend
|
||||
/// * `collection_id` - Target collection
|
||||
/// * `media_id` - Media item to remove
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// `Ok(())` on success
|
||||
pub async fn remove_member(
|
||||
storage: &DynStorageBackend,
|
||||
collection_id: Uuid,
|
||||
|
|
@ -49,6 +85,19 @@ pub async fn remove_member(
|
|||
.await
|
||||
}
|
||||
|
||||
/// Returns all media items in a collection.
|
||||
///
|
||||
/// Virtual collections are evaluated dynamically using their filter query.
|
||||
/// Manual collections return stored members.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `storage` - Storage backend
|
||||
/// * `collection_id` - Collection to query
|
||||
///
|
||||
/// # Returns
|
||||
///
|
||||
/// List of media items in the collection
|
||||
pub async fn get_members(
|
||||
storage: &DynStorageBackend,
|
||||
collection_id: Uuid,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue