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
|
|
@ -583,8 +583,7 @@ impl StorageBackend for PostgresBackend {
|
|||
crate::storage::migrations::run_postgres_migrations(client).await
|
||||
}
|
||||
|
||||
// ---- Root directories ----
|
||||
|
||||
// Root directories
|
||||
async fn add_root_dir(&self, path: PathBuf) -> Result<()> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -638,8 +637,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ---- Media CRUD ----
|
||||
|
||||
// Media CRUD
|
||||
async fn insert_media(&self, item: &MediaItem) -> Result<()> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -1032,8 +1030,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(count as u64)
|
||||
}
|
||||
|
||||
// ---- Batch Operations ----
|
||||
|
||||
// Batch Operations
|
||||
async fn batch_delete_media(&self, ids: &[MediaId]) -> Result<u64> {
|
||||
if ids.is_empty() {
|
||||
return Ok(0);
|
||||
|
|
@ -1089,8 +1086,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(rows)
|
||||
}
|
||||
|
||||
// ---- Tags ----
|
||||
|
||||
// Tags
|
||||
async fn create_tag(
|
||||
&self,
|
||||
name: &str,
|
||||
|
|
@ -1257,8 +1253,7 @@ impl StorageBackend for PostgresBackend {
|
|||
rows.iter().map(row_to_tag).collect()
|
||||
}
|
||||
|
||||
// ---- Collections ----
|
||||
|
||||
// Collections
|
||||
async fn create_collection(
|
||||
&self,
|
||||
name: &str,
|
||||
|
|
@ -1499,8 +1494,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(items)
|
||||
}
|
||||
|
||||
// ---- Search ----
|
||||
|
||||
// Search
|
||||
async fn search(&self, request: &SearchRequest) -> Result<SearchResults> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -1666,8 +1660,7 @@ impl StorageBackend for PostgresBackend {
|
|||
})
|
||||
}
|
||||
|
||||
// ---- Audit ----
|
||||
|
||||
// Audit
|
||||
async fn record_audit(&self, entry: &AuditEntry) -> Result<()> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -1739,8 +1732,7 @@ impl StorageBackend for PostgresBackend {
|
|||
rows.iter().map(row_to_audit_entry).collect()
|
||||
}
|
||||
|
||||
// ---- Custom fields ----
|
||||
|
||||
// Custom fields
|
||||
async fn set_custom_field(
|
||||
&self,
|
||||
media_id: MediaId,
|
||||
|
|
@ -1821,8 +1813,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ---- Duplicates ----
|
||||
|
||||
// Duplicates
|
||||
async fn find_duplicates(&self) -> Result<Vec<Vec<MediaItem>>> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -2007,8 +1998,7 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(groups)
|
||||
}
|
||||
|
||||
// ---- Database management ----
|
||||
|
||||
// Database management
|
||||
async fn database_stats(&self) -> Result<crate::storage::DatabaseStats> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -2524,7 +2514,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Ratings =====
|
||||
async fn rate_media(
|
||||
&self,
|
||||
user_id: crate::users::UserId,
|
||||
|
|
@ -2635,7 +2624,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Comments =====
|
||||
async fn add_comment(
|
||||
&self,
|
||||
user_id: crate::users::UserId,
|
||||
|
|
@ -2712,7 +2700,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Favorites =====
|
||||
async fn add_favorite(
|
||||
&self,
|
||||
user_id: crate::users::UserId,
|
||||
|
|
@ -2838,7 +2825,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(count > 0)
|
||||
}
|
||||
|
||||
// ===== Share Links =====
|
||||
async fn create_share_link(
|
||||
&self,
|
||||
media_id: MediaId,
|
||||
|
|
@ -2942,7 +2928,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Playlists =====
|
||||
async fn create_playlist(
|
||||
&self,
|
||||
owner_id: crate::users::UserId,
|
||||
|
|
@ -3250,7 +3235,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Analytics =====
|
||||
async fn record_usage_event(
|
||||
&self,
|
||||
event: &crate::analytics::UsageEvent,
|
||||
|
|
@ -3540,7 +3524,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(affected)
|
||||
}
|
||||
|
||||
// ===== Subtitles =====
|
||||
async fn add_subtitle(
|
||||
&self,
|
||||
subtitle: &crate::subtitles::Subtitle,
|
||||
|
|
@ -3652,7 +3635,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== External Metadata (Enrichment) =====
|
||||
async fn store_external_metadata(
|
||||
&self,
|
||||
meta: &crate::enrichment::ExternalMetadata,
|
||||
|
|
@ -3742,7 +3724,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== Transcode Sessions =====
|
||||
async fn create_transcode_session(
|
||||
&self,
|
||||
session: &crate::transcode::TranscodeSession,
|
||||
|
|
@ -3930,8 +3911,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(affected)
|
||||
}
|
||||
|
||||
// ===== Session Management =====
|
||||
|
||||
async fn create_session(
|
||||
&self,
|
||||
session: &crate::storage::SessionData,
|
||||
|
|
@ -4666,10 +4645,6 @@ impl StorageBackend for PostgresBackend {
|
|||
items
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Managed Storage
|
||||
// =========================================================================
|
||||
|
||||
async fn insert_managed_media(&self, item: &MediaItem) -> Result<()> {
|
||||
let client = self.pool.get().await.map_err(|e| {
|
||||
PinakesError::Database(format!("failed to get connection: {e}"))
|
||||
|
|
@ -4967,10 +4942,6 @@ impl StorageBackend for PostgresBackend {
|
|||
})
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Sync Devices
|
||||
// =========================================================================
|
||||
|
||||
async fn register_device(
|
||||
&self,
|
||||
device: &crate::sync::SyncDevice,
|
||||
|
|
@ -5188,10 +5159,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Sync Log
|
||||
// =========================================================================
|
||||
|
||||
async fn record_sync_change(
|
||||
&self,
|
||||
change: &crate::sync::SyncLogEntry,
|
||||
|
|
@ -5310,10 +5277,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Device Sync State
|
||||
// =========================================================================
|
||||
|
||||
async fn get_device_sync_state(
|
||||
&self,
|
||||
device_id: crate::sync::DeviceId,
|
||||
|
|
@ -5437,10 +5400,6 @@ impl StorageBackend for PostgresBackend {
|
|||
)
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Upload Sessions
|
||||
// =========================================================================
|
||||
|
||||
async fn create_upload_session(
|
||||
&self,
|
||||
session: &crate::sync::UploadSession,
|
||||
|
|
@ -5618,10 +5577,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Sync Conflicts
|
||||
// =========================================================================
|
||||
|
||||
async fn record_conflict(
|
||||
&self,
|
||||
conflict: &crate::sync::SyncConflict,
|
||||
|
|
@ -5737,10 +5692,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Shares
|
||||
// =========================================================================
|
||||
|
||||
async fn create_share(
|
||||
&self,
|
||||
share: &crate::sharing::Share,
|
||||
|
|
@ -6050,10 +6001,10 @@ impl StorageBackend for PostgresBackend {
|
|||
|
||||
for share in shares {
|
||||
// Skip expired shares
|
||||
if let Some(exp) = share.expires_at {
|
||||
if exp < now {
|
||||
continue;
|
||||
}
|
||||
if let Some(exp) = share.expires_at
|
||||
&& exp < now
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
match (&share.recipient, user_id) {
|
||||
|
|
@ -6167,10 +6118,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(result)
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Share Activity
|
||||
// =========================================================================
|
||||
|
||||
async fn record_share_activity(
|
||||
&self,
|
||||
activity: &crate::sharing::ShareActivity,
|
||||
|
|
@ -6244,10 +6191,6 @@ impl StorageBackend for PostgresBackend {
|
|||
)
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// Share Notifications
|
||||
// =========================================================================
|
||||
|
||||
async fn create_share_notification(
|
||||
&self,
|
||||
notification: &crate::sharing::ShareNotification,
|
||||
|
|
@ -6349,8 +6292,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// ===== File Management =====
|
||||
|
||||
async fn rename_media(&self, id: MediaId, new_name: &str) -> Result<String> {
|
||||
// Validate the new name
|
||||
if new_name.is_empty() || new_name.contains('/') || new_name.contains('\\')
|
||||
|
|
@ -6468,8 +6409,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(old_path)
|
||||
}
|
||||
|
||||
// ===== Trash / Soft Delete =====
|
||||
|
||||
async fn soft_delete_media(&self, id: MediaId) -> Result<()> {
|
||||
let client = self
|
||||
.pool
|
||||
|
|
@ -6671,8 +6610,6 @@ impl StorageBackend for PostgresBackend {
|
|||
Ok(count as u64)
|
||||
}
|
||||
|
||||
// ===== Markdown Links (Obsidian-style) =====
|
||||
|
||||
async fn save_markdown_links(
|
||||
&self,
|
||||
media_id: MediaId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue