Skip to main content

ClipManager

Struct ClipManager 

Source
pub struct ClipManager { /* private fields */ }
Expand description

Main clip management system.

Implementations§

Source§

impl ClipManager

Source

pub async fn new(database_url: impl AsRef<str>) -> ClipResult<Self>

Creates a new clip manager.

§Errors

Returns an error if the database cannot be initialized.

Source

pub async fn add_clip(&self, clip: Clip) -> ClipResult<ClipId>

Adds a clip to the database.

§Errors

Returns an error if the clip cannot be saved.

Source

pub async fn get_clip(&self, clip_id: &ClipId) -> ClipResult<Clip>

Gets a clip by ID.

§Errors

Returns an error if the clip is not found.

Source

pub async fn update_clip(&self, clip: Clip) -> ClipResult<()>

Updates a clip.

§Errors

Returns an error if the clip cannot be updated.

Source

pub async fn delete_clip(&self, clip_id: &ClipId) -> ClipResult<()>

Deletes a clip.

§Errors

Returns an error if the clip cannot be deleted.

Source

pub async fn get_all_clips(&self) -> ClipResult<Vec<Clip>>

Gets all clips.

§Errors

Returns an error if clips cannot be loaded.

Source

pub async fn clip_count(&self) -> ClipResult<i64>

Returns the number of clips.

§Errors

Returns an error if the count fails.

Source

pub async fn add_clips(&self, clips: Vec<Clip>) -> ClipResult<Vec<ClipId>>

Adds multiple clips in a single database transaction (bulk import).

Significantly more efficient than calling add_clip() in a loop.

§Errors

Returns an error if the transaction or any individual save fails.

Source

pub async fn list_clips( &self, page: i64, page_size: i64, ) -> ClipResult<Vec<Clip>>

Lists clips with pagination.

page is 0-indexed; page_size is the number of clips per page.

§Errors

Returns an error if the query fails.

Source

pub async fn search_paged( &self, query: &str, page: i64, page_size: i64, ) -> ClipResult<Vec<Clip>>

Searches clips by query string with pagination.

§Errors

Returns an error if the search fails.

Source

pub async fn search(&self, query: &str) -> ClipResult<Vec<Clip>>

Searches clips by query string.

§Errors

Returns an error if the search fails.

Source

pub async fn filter(&self, filter: &ClipFilter) -> ClipResult<Vec<Clip>>

Filters clips using advanced criteria.

§Errors

Returns an error if the filter operation fails.

Source

pub fn create_bin(&mut self, name: impl Into<String>) -> BinId

Creates a new bin.

Source

pub fn get_bin(&self, bin_id: &BinId) -> ClipResult<&Bin>

Gets a bin by ID.

§Errors

Returns an error if the bin is not found.

Source

pub fn get_bin_mut(&mut self, bin_id: &BinId) -> ClipResult<&mut Bin>

Gets a mutable bin by ID.

§Errors

Returns an error if the bin is not found.

Source

pub fn add_clip_to_bin( &mut self, bin_id: &BinId, clip_id: ClipId, ) -> ClipResult<()>

Adds a clip to a bin.

§Errors

Returns an error if the bin is not found.

Source

pub fn list_bins(&self) -> Vec<&Bin>

Lists all bins.

Source

pub fn create_folder(&mut self, name: impl Into<String>) -> FolderId

Creates a new folder.

Source

pub fn create_child_folder( &mut self, name: impl Into<String>, parent_id: FolderId, ) -> FolderId

Creates a child folder.

Source

pub fn get_folder(&self, folder_id: &FolderId) -> ClipResult<&Folder>

Gets a folder by ID.

§Errors

Returns an error if the folder is not found.

Source

pub fn create_collection(&mut self, name: impl Into<String>) -> CollectionId

Creates a new collection.

Source

pub fn get_collection( &self, collection_id: &CollectionId, ) -> ClipResult<&Collection>

Gets a collection by ID.

§Errors

Returns an error if the collection is not found.

Source

pub fn add_clip_to_collection( &mut self, collection_id: &CollectionId, clip_id: ClipId, ) -> ClipResult<()>

Adds a clip to a collection.

§Errors

Returns an error if the collection is not found.

Source

pub fn create_smart_collection(&mut self, smart_collection: SmartCollection)

Creates a new smart collection.

Source

pub async fn update_smart_collections(&mut self) -> ClipResult<()>

Updates all smart collections.

§Errors

Returns an error if clips cannot be loaded.

Source

pub fn add_marker(&mut self, clip_id: ClipId, marker: Marker)

Adds a marker to a clip.

Source

pub fn get_markers(&self, clip_id: &ClipId) -> Vec<&Marker>

Gets markers for a clip.

Source

pub fn remove_marker( &mut self, clip_id: &ClipId, marker_id: &MarkerId, ) -> ClipResult<()>

Removes a marker.

§Errors

Returns an error if the marker is not found.

Source

pub fn add_take(&mut self, take: Take)

Adds a take.

Source

pub fn get_scene_takes(&self, scene: &str) -> Vec<&Take>

Gets takes for a scene.

Source

pub fn get_clip_takes(&self, clip_id: &ClipId) -> Vec<&Take>

Gets takes for a clip.

Source

pub fn add_proxy(&mut self, link: ProxyLink)

Adds a proxy link.

Source

pub fn get_proxies(&self, clip_id: &ClipId) -> Vec<&ProxyLink>

Gets proxy links for a clip.

Source

pub fn get_best_proxy(&self, clip_id: &ClipId) -> Option<&ProxyLink>

Gets the best proxy for a clip.

Source

pub async fn scan_directory( &self, path: impl AsRef<Path>, ) -> ClipResult<Vec<Clip>>

Scans a directory for media files.

§Errors

Returns an error if the scan fails.

Source

pub fn import_clips(&self, paths: Vec<PathBuf>) -> Vec<Clip>

Imports clips from file paths.

Source

pub async fn export_csv(&self, clip_ids: &[ClipId]) -> ClipResult<String>

Exports clips to CSV.

§Errors

Returns an error if the export fails.

Source

pub async fn export_edl( &self, clip_ids: &[ClipId], frame_rate: Rational, ) -> ClipResult<String>

Exports clips to EDL.

§Errors

Returns an error if the export fails.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more