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 1283 additions and 740 deletions
|
|
@ -142,29 +142,13 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
) -> Result<()>;
|
||||
|
||||
// Batch operations (transactional where supported)
|
||||
async fn batch_delete_media(&self, ids: &[MediaId]) -> Result<u64> {
|
||||
let mut count = 0u64;
|
||||
for id in ids {
|
||||
self.delete_media(*id).await?;
|
||||
count += 1;
|
||||
}
|
||||
Ok(count)
|
||||
}
|
||||
async fn batch_delete_media(&self, ids: &[MediaId]) -> Result<u64>;
|
||||
|
||||
async fn batch_tag_media(
|
||||
&self,
|
||||
media_ids: &[MediaId],
|
||||
tag_ids: &[Uuid],
|
||||
) -> Result<u64> {
|
||||
let mut count = 0u64;
|
||||
for media_id in media_ids {
|
||||
for tag_id in tag_ids {
|
||||
self.tag_media(*media_id, *tag_id).await?;
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
Ok(count)
|
||||
}
|
||||
) -> Result<u64>;
|
||||
|
||||
// Integrity
|
||||
async fn list_media_paths(
|
||||
|
|
@ -342,7 +326,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
}
|
||||
}
|
||||
|
||||
// ===== Ratings =====
|
||||
async fn rate_media(
|
||||
&self,
|
||||
user_id: UserId,
|
||||
|
|
@ -358,7 +341,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
) -> Result<Option<Rating>>;
|
||||
async fn delete_rating(&self, id: Uuid) -> Result<()>;
|
||||
|
||||
// ===== Comments =====
|
||||
async fn add_comment(
|
||||
&self,
|
||||
user_id: UserId,
|
||||
|
|
@ -370,7 +352,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
-> Result<Vec<Comment>>;
|
||||
async fn delete_comment(&self, id: Uuid) -> Result<()>;
|
||||
|
||||
// ===== Favorites =====
|
||||
async fn add_favorite(
|
||||
&self,
|
||||
user_id: UserId,
|
||||
|
|
@ -392,7 +373,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
media_id: MediaId,
|
||||
) -> Result<bool>;
|
||||
|
||||
// ===== Share Links =====
|
||||
async fn create_share_link(
|
||||
&self,
|
||||
media_id: MediaId,
|
||||
|
|
@ -405,7 +385,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
async fn increment_share_views(&self, token: &str) -> Result<()>;
|
||||
async fn delete_share_link(&self, id: Uuid) -> Result<()>;
|
||||
|
||||
// ===== Playlists =====
|
||||
async fn create_playlist(
|
||||
&self,
|
||||
owner_id: UserId,
|
||||
|
|
@ -450,7 +429,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
new_position: i32,
|
||||
) -> Result<()>;
|
||||
|
||||
// ===== Analytics =====
|
||||
async fn record_usage_event(&self, event: &UsageEvent) -> Result<()>;
|
||||
async fn get_usage_events(
|
||||
&self,
|
||||
|
|
@ -477,7 +455,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
) -> Result<Option<f64>>;
|
||||
async fn cleanup_old_events(&self, before: DateTime<Utc>) -> Result<u64>;
|
||||
|
||||
// ===== Subtitles =====
|
||||
async fn add_subtitle(&self, subtitle: &Subtitle) -> Result<()>;
|
||||
async fn get_media_subtitles(
|
||||
&self,
|
||||
|
|
@ -490,7 +467,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
offset_ms: i64,
|
||||
) -> Result<()>;
|
||||
|
||||
// ===== External Metadata (Enrichment) =====
|
||||
async fn store_external_metadata(
|
||||
&self,
|
||||
meta: &ExternalMetadata,
|
||||
|
|
@ -501,7 +477,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
) -> Result<Vec<ExternalMetadata>>;
|
||||
async fn delete_external_metadata(&self, id: Uuid) -> Result<()>;
|
||||
|
||||
// ===== Transcode Sessions =====
|
||||
async fn create_transcode_session(
|
||||
&self,
|
||||
session: &TranscodeSession,
|
||||
|
|
@ -522,7 +497,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
before: DateTime<Utc>,
|
||||
) -> Result<u64>;
|
||||
|
||||
// ===== Session Management =====
|
||||
/// Create a new session in the database
|
||||
async fn create_session(&self, session: &SessionData) -> Result<()>;
|
||||
|
||||
|
|
@ -623,8 +597,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
pagination: &Pagination,
|
||||
) -> Result<Vec<MediaItem>>;
|
||||
|
||||
// ===== Managed Storage =====
|
||||
|
||||
/// Insert a media item that uses managed storage
|
||||
async fn insert_managed_media(&self, item: &MediaItem) -> Result<()>;
|
||||
|
||||
|
|
@ -658,8 +630,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Get managed storage statistics
|
||||
async fn managed_storage_stats(&self) -> Result<ManagedStorageStats>;
|
||||
|
||||
// ===== Sync Devices =====
|
||||
|
||||
/// Register a new sync device
|
||||
async fn register_device(
|
||||
&self,
|
||||
|
|
@ -695,8 +665,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Update the last_seen_at timestamp for a device
|
||||
async fn touch_device(&self, id: crate::sync::DeviceId) -> Result<()>;
|
||||
|
||||
// ===== Sync Log =====
|
||||
|
||||
/// Record a change in the sync log
|
||||
async fn record_sync_change(
|
||||
&self,
|
||||
|
|
@ -716,8 +684,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Clean up old sync log entries
|
||||
async fn cleanup_old_sync_log(&self, before: DateTime<Utc>) -> Result<u64>;
|
||||
|
||||
// ===== Device Sync State =====
|
||||
|
||||
/// Get sync state for a device and path
|
||||
async fn get_device_sync_state(
|
||||
&self,
|
||||
|
|
@ -737,8 +703,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
device_id: crate::sync::DeviceId,
|
||||
) -> Result<Vec<crate::sync::DeviceSyncState>>;
|
||||
|
||||
// ===== Upload Sessions (Chunked Uploads) =====
|
||||
|
||||
/// Create a new upload session
|
||||
async fn create_upload_session(
|
||||
&self,
|
||||
|
|
@ -773,8 +737,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Clean up expired upload sessions
|
||||
async fn cleanup_expired_uploads(&self) -> Result<u64>;
|
||||
|
||||
// ===== Sync Conflicts =====
|
||||
|
||||
/// Record a sync conflict
|
||||
async fn record_conflict(
|
||||
&self,
|
||||
|
|
@ -794,8 +756,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
resolution: crate::config::ConflictResolution,
|
||||
) -> Result<()>;
|
||||
|
||||
// ===== Enhanced Sharing =====
|
||||
|
||||
/// Create a new share
|
||||
async fn create_share(
|
||||
&self,
|
||||
|
|
@ -872,8 +832,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Clean up expired shares
|
||||
async fn cleanup_expired_shares(&self) -> Result<u64>;
|
||||
|
||||
// ===== Share Activity =====
|
||||
|
||||
/// Record share activity
|
||||
async fn record_share_activity(
|
||||
&self,
|
||||
|
|
@ -887,8 +845,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
pagination: &Pagination,
|
||||
) -> Result<Vec<crate::sharing::ShareActivity>>;
|
||||
|
||||
// ===== Share Notifications =====
|
||||
|
||||
/// Create a share notification
|
||||
async fn create_share_notification(
|
||||
&self,
|
||||
|
|
@ -907,8 +863,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Mark all notifications as read for a user
|
||||
async fn mark_all_notifications_read(&self, user_id: UserId) -> Result<()>;
|
||||
|
||||
// ===== File Management =====
|
||||
|
||||
/// Rename a media item (changes file_name and updates path accordingly).
|
||||
/// For external storage, this actually renames the file on disk.
|
||||
/// For managed storage, this only updates the metadata.
|
||||
|
|
@ -939,8 +893,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
Ok(results)
|
||||
}
|
||||
|
||||
// ===== Trash / Soft Delete =====
|
||||
|
||||
/// Soft delete a media item (set deleted_at timestamp).
|
||||
async fn soft_delete_media(&self, id: MediaId) -> Result<()>;
|
||||
|
||||
|
|
@ -960,8 +912,6 @@ pub trait StorageBackend: Send + Sync + 'static {
|
|||
/// Count items in trash.
|
||||
async fn count_trash(&self) -> Result<u64>;
|
||||
|
||||
// ===== Markdown Links (Obsidian-style) =====
|
||||
|
||||
/// Save extracted markdown links for a media item.
|
||||
/// This replaces any existing links for the source media.
|
||||
async fn save_markdown_links(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue