| Crates.io | moosicbox_library_models |
| lib.rs | moosicbox_library_models |
| version | 0.1.4 |
| created_at | 2024-10-04 15:43:39.121502+00 |
| updated_at | 2025-07-21 19:25:11.098174+00 |
| description | MoosicBox Library Music API models package |
| homepage | |
| repository | https://github.com/MoosicBox/MoosicBox |
| max_upload_size | |
| id | 1396717 |
| size | 89,025 |
Data models for MoosicBox music library management and storage.
The MoosicBox Library Models package provides:
Add this to your Cargo.toml:
[dependencies]
moosicbox_library_models = { path = "../library/models" }
# Enable specific features
moosicbox_library_models = {
path = "../library/models",
features = ["api", "db"]
}
use moosicbox_library_models::{LibraryArtist, LibraryAlbum, LibraryTrack};
use moosicbox_music_models::ApiSources;
// Create a library artist
let artist = LibraryArtist {
id: 1,
title: "The Beatles".to_string(),
cover: Some("/covers/beatles.jpg".to_string()),
api_sources: ApiSources::default(),
};
// Create a library album
let album = LibraryAlbum {
id: 1,
title: "Abbey Road".to_string(),
artist: "The Beatles".to_string(),
artist_id: 1,
album_type: LibraryAlbumType::Lp,
date_released: Some("1969-09-26".to_string()),
..Default::default()
};