refactor(indexeddb): add transaction fn for putting media into IndexedDB
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
This commit is contained in:
committed by
Benjamin Bouvier
parent
63a3c2d51a
commit
1127184db2
@@ -225,6 +225,12 @@ impl<'a> IndexeddbMediaStoreTransaction<'a> {
|
||||
self.add_item(media).await
|
||||
}
|
||||
|
||||
/// Puts [`Media`] in IndexedDB object. If an item with the same key already
|
||||
/// exists, it will be overwritten.
|
||||
pub async fn put_media(&self, media: &Media) -> Result<(), TransactionError> {
|
||||
self.put_item(media).await
|
||||
}
|
||||
|
||||
/// Adds [`Media`] to IndexedDB if the size of [`IndexedMedia::content`][1]
|
||||
/// does not exceed [`MediaRetentionPolicy::max_file_size]. If an item with
|
||||
/// the same key already exists, it will be overwritten.
|
||||
|
||||
Reference in New Issue
Block a user