pub struct Track {
pub name: String,
pub artist: String,
pub playcount: u32,
pub timestamp: Option<u64>,
pub album: Option<String>,
pub album_artist: Option<String>,
}Expand description
Represents a music track with associated metadata.
This structure contains track information as parsed from Last.fm pages, including play count and optional timestamp data for scrobbles.
§Examples
use lastfm_edit::Track;
let track = Track {
name: "Paranoid Android".to_string(),
artist: "Radiohead".to_string(),
playcount: 42,
timestamp: Some(1640995200), // Unix timestamp
album: Some("OK Computer".to_string()),
album_artist: Some("Radiohead".to_string()),
};
println!("{} by {} (played {} times)", track.name, track.artist, track.playcount);
if let Some(album) = &track.album {
println!("From album: {}", album);
}Fields§
§name: StringThe track name/title
artist: StringThe artist name
playcount: u32Number of times this track has been played/scrobbled
timestamp: Option<u64>Unix timestamp of when this track was scrobbled (if available)
This field is populated when tracks are retrieved from recent scrobbles
or individual scrobble data, but may be None for aggregate track listings.
album: Option<String>The album name (if available)
This field is populated when tracks are retrieved from recent scrobbles
where album information is available in the edit forms. May be None
for aggregate track listings or when album information is not available.
album_artist: Option<String>The album artist name (if available and different from track artist)
This field is populated when tracks are retrieved from recent scrobbles
where album artist information is available. May be None for tracks
where the album artist is the same as the track artist, or when this
information is not available.