pub struct ClipManager { /* private fields */ }Expand description
Main clip management system.
Implementations§
Source§impl ClipManager
impl ClipManager
Sourcepub async fn new(database_url: impl AsRef<str>) -> ClipResult<Self>
pub async fn new(database_url: impl AsRef<str>) -> ClipResult<Self>
Sourcepub async fn add_clip(&self, clip: Clip) -> ClipResult<ClipId>
pub async fn add_clip(&self, clip: Clip) -> ClipResult<ClipId>
Sourcepub async fn get_clip(&self, clip_id: &ClipId) -> ClipResult<Clip>
pub async fn get_clip(&self, clip_id: &ClipId) -> ClipResult<Clip>
Sourcepub async fn update_clip(&self, clip: Clip) -> ClipResult<()>
pub async fn update_clip(&self, clip: Clip) -> ClipResult<()>
Sourcepub async fn delete_clip(&self, clip_id: &ClipId) -> ClipResult<()>
pub async fn delete_clip(&self, clip_id: &ClipId) -> ClipResult<()>
Sourcepub async fn get_all_clips(&self) -> ClipResult<Vec<Clip>>
pub async fn get_all_clips(&self) -> ClipResult<Vec<Clip>>
Sourcepub async fn clip_count(&self) -> ClipResult<i64>
pub async fn clip_count(&self) -> ClipResult<i64>
Sourcepub async fn add_clips(&self, clips: Vec<Clip>) -> ClipResult<Vec<ClipId>>
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.
Sourcepub async fn list_clips(
&self,
page: i64,
page_size: i64,
) -> ClipResult<Vec<Clip>>
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.
Sourcepub async fn search_paged(
&self,
query: &str,
page: i64,
page_size: i64,
) -> ClipResult<Vec<Clip>>
pub async fn search_paged( &self, query: &str, page: i64, page_size: i64, ) -> ClipResult<Vec<Clip>>
Sourcepub async fn filter(&self, filter: &ClipFilter) -> ClipResult<Vec<Clip>>
pub async fn filter(&self, filter: &ClipFilter) -> ClipResult<Vec<Clip>>
Sourcepub fn create_bin(&mut self, name: impl Into<String>) -> BinId
pub fn create_bin(&mut self, name: impl Into<String>) -> BinId
Creates a new bin.
Sourcepub fn get_bin(&self, bin_id: &BinId) -> ClipResult<&Bin>
pub fn get_bin(&self, bin_id: &BinId) -> ClipResult<&Bin>
Sourcepub fn get_bin_mut(&mut self, bin_id: &BinId) -> ClipResult<&mut Bin>
pub fn get_bin_mut(&mut self, bin_id: &BinId) -> ClipResult<&mut Bin>
Sourcepub fn add_clip_to_bin(
&mut self,
bin_id: &BinId,
clip_id: ClipId,
) -> ClipResult<()>
pub fn add_clip_to_bin( &mut self, bin_id: &BinId, clip_id: ClipId, ) -> ClipResult<()>
Sourcepub fn create_folder(&mut self, name: impl Into<String>) -> FolderId
pub fn create_folder(&mut self, name: impl Into<String>) -> FolderId
Creates a new folder.
Sourcepub fn create_child_folder(
&mut self,
name: impl Into<String>,
parent_id: FolderId,
) -> FolderId
pub fn create_child_folder( &mut self, name: impl Into<String>, parent_id: FolderId, ) -> FolderId
Creates a child folder.
Sourcepub fn get_folder(&self, folder_id: &FolderId) -> ClipResult<&Folder>
pub fn get_folder(&self, folder_id: &FolderId) -> ClipResult<&Folder>
Sourcepub fn create_collection(&mut self, name: impl Into<String>) -> CollectionId
pub fn create_collection(&mut self, name: impl Into<String>) -> CollectionId
Creates a new collection.
Sourcepub fn get_collection(
&self,
collection_id: &CollectionId,
) -> ClipResult<&Collection>
pub fn get_collection( &self, collection_id: &CollectionId, ) -> ClipResult<&Collection>
Sourcepub fn add_clip_to_collection(
&mut self,
collection_id: &CollectionId,
clip_id: ClipId,
) -> ClipResult<()>
pub fn add_clip_to_collection( &mut self, collection_id: &CollectionId, clip_id: ClipId, ) -> ClipResult<()>
Sourcepub fn create_smart_collection(&mut self, smart_collection: SmartCollection)
pub fn create_smart_collection(&mut self, smart_collection: SmartCollection)
Creates a new smart collection.
Sourcepub async fn update_smart_collections(&mut self) -> ClipResult<()>
pub async fn update_smart_collections(&mut self) -> ClipResult<()>
Sourcepub fn add_marker(&mut self, clip_id: ClipId, marker: Marker)
pub fn add_marker(&mut self, clip_id: ClipId, marker: Marker)
Adds a marker to a clip.
Sourcepub fn get_markers(&self, clip_id: &ClipId) -> Vec<&Marker>
pub fn get_markers(&self, clip_id: &ClipId) -> Vec<&Marker>
Gets markers for a clip.
Sourcepub fn remove_marker(
&mut self,
clip_id: &ClipId,
marker_id: &MarkerId,
) -> ClipResult<()>
pub fn remove_marker( &mut self, clip_id: &ClipId, marker_id: &MarkerId, ) -> ClipResult<()>
Sourcepub fn get_scene_takes(&self, scene: &str) -> Vec<&Take>
pub fn get_scene_takes(&self, scene: &str) -> Vec<&Take>
Gets takes for a scene.
Sourcepub fn get_clip_takes(&self, clip_id: &ClipId) -> Vec<&Take>
pub fn get_clip_takes(&self, clip_id: &ClipId) -> Vec<&Take>
Gets takes for a clip.
Sourcepub fn get_proxies(&self, clip_id: &ClipId) -> Vec<&ProxyLink>
pub fn get_proxies(&self, clip_id: &ClipId) -> Vec<&ProxyLink>
Gets proxy links for a clip.
Sourcepub fn get_best_proxy(&self, clip_id: &ClipId) -> Option<&ProxyLink>
pub fn get_best_proxy(&self, clip_id: &ClipId) -> Option<&ProxyLink>
Gets the best proxy for a clip.
Sourcepub async fn scan_directory(
&self,
path: impl AsRef<Path>,
) -> ClipResult<Vec<Clip>>
pub async fn scan_directory( &self, path: impl AsRef<Path>, ) -> ClipResult<Vec<Clip>>
Sourcepub async fn export_csv(&self, clip_ids: &[ClipId]) -> ClipResult<String>
pub async fn export_csv(&self, clip_ids: &[ClipId]) -> ClipResult<String>
Sourcepub async fn export_edl(
&self,
clip_ids: &[ClipId],
frame_rate: Rational,
) -> ClipResult<String>
pub async fn export_edl( &self, clip_ids: &[ClipId], frame_rate: Rational, ) -> ClipResult<String>
Auto Trait Implementations§
impl !RefUnwindSafe for ClipManager
impl !UnwindSafe for ClipManager
impl Freeze for ClipManager
impl Send for ClipManager
impl Sync for ClipManager
impl Unpin for ClipManager
impl UnsafeUnpin for ClipManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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