Skip to main content

Crate moosicbox_scan

Crate moosicbox_scan 

Source
Expand description

Music library scanning and indexing for MoosicBox.

This crate provides functionality for scanning music libraries from both local filesystem sources and remote music API services (e.g., streaming platforms). It discovers music files, extracts metadata, downloads artwork, and updates the MoosicBox database with artists, albums, and tracks.

§Features

  • Scan local music files with metadata extraction
  • Scan remote music services via API integrations
  • Progress tracking for long-running scan operations
  • Artwork downloading and caching
  • Database synchronization with deduplication

§Example

// Create a scanner for a specific origin
let scanner = Scanner::from_origin(db, ScanOrigin::Local).await?;

// Start scanning
scanner.scan(music_apis, db).await?;

Re-exports§

pub use moosicbox_scan_models as models;

Modules§

api
HTTP API endpoints for music library scanning.
db
Database operations for scan locations and origins. Database operations for scan locations and origins.
event
Progress event types and listener registration for scan operations. Progress event types and listener registration for scan operations.
local
Local filesystem scanning functionality.
music_api
Music API scanning functionality for remote streaming services. Music API scanning functionality for remote streaming services.
output
Data structures and database update operations for scan results. Data structures and database update operations for scan results.

Structs§

Scanner
Manages scanning operations for music library sources.

Enums§

ScanError
Errors that can occur during scanning operations.

Functions§

add_scan_path
Adds a local filesystem path to the scan locations.
cancel
Cancels any ongoing scan operations.
disable_scan_origin
Disables a scan origin in the database.
enable_scan_origin
Enables a scan origin in the database.
get_scan_origins
Retrieves all enabled scan origins from the database.
get_scan_paths
Retrieves all configured local scan paths from the database.
is_scan_origin_enabled
Checks if a scan origin is enabled in the database.
remove_scan_path
Removes a local filesystem path from the scan locations.
run_scan
Runs a scan for the specified origins (or all enabled origins if none specified).

Type Aliases§

ScanOrigin
Type alias for track API sources used as scan origins.