MoosicBox App Models
Data models and structures for MoosicBox native applications.
Overview
The MoosicBox App Models package provides:
- Connection Models: API connection configuration and management
- Music API Settings: Music service authentication and configuration
- Download Settings: Download location and management configuration
- Scan Settings: Music library scan path configuration
- Feature Integration: Optional integration with music API authentication
Models
Connection
- name: Display name for the connection
- api_url: MoosicBox server API endpoint URL
MusicApiSettings
- id: Unique identifier for the music service
- name: Display name of the music service
- logged_in: Authentication status
- supports_scan: Whether the service supports library scanning
- scan_enabled: Whether scanning is currently enabled
- run_scan_endpoint: Optional API endpoint for triggering scans
- auth_method: Optional authentication method configuration (requires
music-api-apifeature)
DownloadSettings
- download_locations: List of available download locations with IDs
- default_download_location: Default download path
ScanSettings
- scan_paths: List of local filesystem paths to scan for music
Installation
Add this to your Cargo.toml:
[]
= { = "../app/models" }
# Or disable default features and enable only specific features
= {
path = "../app/models",
= false,
= ["music-api-api"]
}
Usage
Connection Management
use Connection;
let connection = Connection ;
Music API Configuration
use MusicApiSettings;
use AuthMethod;
let tidal_settings = MusicApiSettings ;
Download Configuration
use DownloadSettings;
let download_settings = DownloadSettings ;
Feature Flags
Default Features
music-api-api: Integration with MoosicBox music API authentication (includesAuthMethod)auth-poll: Support for poll-based authentication flowsauth-username-password: Support for username/password authentication
Additional Features
fail-on-warnings: Treat compiler warnings as errors
Dependencies
- serde: Serialization and deserialization
- log: Logging functionality
- moosicbox_music_api_api: Music API authentication integration (optional, enabled by default)