qobuz_api/models/file_url.rs
1//! Download URL for a track at a specific quality.
2
3/// Quality format IDs for track downloads.
4pub mod quality {
5 /// MP3 320kbps.
6 pub const MP3_320: i32 = 5;
7 /// FLAC 16-bit/44.1kHz (CD quality).
8 pub const FLAC_16_44: i32 = 6;
9 /// FLAC 24-bit/96kHz (Hi-Res).
10 pub const FLAC_24_96: i32 = 7;
11 /// FLAC 24-bit/192kHz (Hi-Res).
12 pub const FLAC_24_192: i32 = 27;
13}
14
15use serde::{Deserialize, Serialize};
16
17/// Download URL for a track at a specific quality level.
18#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
19pub struct FileUrl {
20 /// Track identifier.
21 pub track_id: Option<i32>,
22 /// Track duration in seconds.
23 pub duration: Option<f64>,
24 /// Download URL.
25 pub url: Option<String>,
26 /// Quality format ID.
27 pub format_id: Option<i32>,
28 /// MIME type of the audio file.
29 pub mime_type: Option<String>,
30 /// Sample rate in kHz.
31 pub sampling_rate: Option<f64>,
32 /// Bit depth.
33 pub bit_depth: Option<i32>,
34 /// Response status code.
35 pub status: Option<i32>,
36 /// Error message if applicable.
37 pub message: Option<String>,
38 /// Error code if applicable.
39 pub code: Option<String>,
40}