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
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" }
# Optional: Enable music API authentication integration
= {
path = "../app/models",
= ["music-api-api"]
}
Usage
Connection Management
use Connection;
let connection = Connection ;
Music API Configuration
use MusicApiSettings;
let tidal_settings = MusicApiSettings ;
Download Configuration
use DownloadSettings;
let download_settings = DownloadSettings ;
Feature Flags
music-api-api: Enable integration with MoosicBox music API authentication
Dependencies
- Serde: Serialization and deserialization
- MoosicBox Music API API: Optional authentication integration