pinakes-core: update remaining modules and tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9e0ff5ea33a5cf697473423e88f167ce6a6a6964
This commit is contained in:
parent
c8425a4c34
commit
3d9f8933d2
44 changed files with 1207 additions and 578 deletions
|
|
@ -85,6 +85,10 @@ impl std::str::FromStr for IntegrityStatus {
|
|||
/// # Returns
|
||||
///
|
||||
/// Report containing orphaned items, untracked files, and moved files
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns [`crate::error::PinakesError`] if the storage operation fails.
|
||||
pub async fn detect_orphans(
|
||||
storage: &DynStorageBackend,
|
||||
) -> Result<OrphanReport> {
|
||||
|
|
@ -283,6 +287,10 @@ async fn detect_untracked_files(
|
|||
}
|
||||
|
||||
/// Resolve orphaned media items by deleting them from the database.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns [`crate::error::PinakesError`] if the storage operation fails.
|
||||
pub async fn resolve_orphans(
|
||||
storage: &DynStorageBackend,
|
||||
action: OrphanAction,
|
||||
|
|
@ -302,6 +310,10 @@ pub async fn resolve_orphans(
|
|||
}
|
||||
|
||||
/// Verify integrity of media files by recomputing hashes and comparing.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns [`crate::error::PinakesError`] if the storage operation fails.
|
||||
pub async fn verify_integrity(
|
||||
storage: &DynStorageBackend,
|
||||
media_ids: Option<&[MediaId]>,
|
||||
|
|
@ -361,6 +373,11 @@ pub async fn verify_integrity(
|
|||
}
|
||||
|
||||
/// Clean up orphaned thumbnail files that don't correspond to any media item.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns [`crate::error::PinakesError`] if the storage operation or
|
||||
/// filesystem access fails.
|
||||
pub async fn cleanup_orphaned_thumbnails(
|
||||
storage: &DynStorageBackend,
|
||||
thumbnail_dir: &Path,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue