diff --git a/src/database/json.rs b/src/database/json.rs index 911045e..a940d9f 100644 --- a/src/database/json.rs +++ b/src/database/json.rs @@ -79,7 +79,7 @@ impl DatabaseJsonBackend for DatabaseJsonFile { mod tests { use super::*; - use crate::{tests::COLLECTION, Artist}; + use crate::{tests::COLLECTION, Artist, TrackFormat}; struct DatabaseJsonTest { json: String, @@ -91,7 +91,7 @@ mod tests { } fn write(&mut self, json: &str) -> Result<(), std::io::Error> { - assert_eq!(self.json, json); + assert_eq!(json, self.json); Ok(()) } } @@ -115,11 +115,17 @@ mod tests { } let track_artist = track_artist.join(","); + let track_format: &'static str = match track.format { + TrackFormat::Flac => stringify!(Flac), + TrackFormat::Mp3 => stringify!(Mp3), + }; + tracks.push(format!( "{{\ \"number\":{track_number},\ \"title\":\"{track_title}\",\ - \"artist\":[{track_artist}]\ + \"artist\":[{track_artist}],\ + \"format\":\"{track_format}\"\ }}" )); } diff --git a/src/lib.rs b/src/lib.rs index 62cdb85..d387c1c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,12 +9,20 @@ pub mod library; /// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID). pub type Mbid = Uuid; +/// The track file format. +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +pub enum TrackFormat { + Flac, + Mp3, +} + /// A single track on an album. #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] pub struct Track { pub number: u32, pub title: String, pub artist: Vec, + pub format: TrackFormat, } /// The album identifier. @@ -67,6 +75,7 @@ mod tests { number: 1, title: "track a.a.1".to_string(), artist: vec!["artist a.a.1".to_string()], + format: TrackFormat::Flac, }, Track { number: 2, @@ -75,11 +84,13 @@ mod tests { "artist a.a.2.1".to_string(), "artist a.a.2.2".to_string(), ], + format: TrackFormat::Flac, }, Track { number: 3, title: "track a.a.3".to_string(), artist: vec!["artist a.a.3".to_string()], + format: TrackFormat::Flac, }, ], }, @@ -93,11 +104,13 @@ mod tests { number: 1, title: "track a.b.1".to_string(), artist: vec!["artist a.b.1".to_string()], + format: TrackFormat::Mp3, }, Track { number: 2, title: "track a.b.2".to_string(), artist: vec!["artist a.b.2".to_string()], + format: TrackFormat::Flac, }, ], }, @@ -117,6 +130,7 @@ mod tests { number: 1, title: "track b.a.1".to_string(), artist: vec!["artist b.a.1".to_string()], + format: TrackFormat::Mp3, }, Track { number: 2, @@ -125,6 +139,7 @@ mod tests { "artist b.a.2.1".to_string(), "artist b.a.2.2".to_string(), ], + format: TrackFormat::Mp3, }, ], }], diff --git a/src/library/beets.rs b/src/library/beets.rs index bf8ff49..98d9a5d 100644 --- a/src/library/beets.rs +++ b/src/library/beets.rs @@ -9,7 +9,7 @@ use std::{ str, }; -use crate::{Album, AlbumId, Artist, ArtistId, Track}; +use crate::{Album, AlbumId, Artist, ArtistId, Track, TrackFormat}; use super::{Error, Library, Query, QueryOption}; @@ -98,6 +98,8 @@ trait LibraryPrivate { const CMD_LIST: &'static str; const LIST_FORMAT_SEPARATOR: &'static str; const LIST_FORMAT_ARG: &'static str; + const TRACK_FORMAT_FLAC: &'static str; + const TRACK_FORMAT_MP3: &'static str; fn list_cmd_and_args(query: &Query) -> Vec; fn list_to_artists(list_output: Vec) -> Result, Error>; @@ -138,8 +140,12 @@ impl LibraryPrivate for Beets { list_format_separator!(), "$title", list_format_separator!(), - "$artist" + "$artist", + list_format_separator!(), + "$format" ); + const TRACK_FORMAT_FLAC: &'static str = "FLAC"; + const TRACK_FORMAT_MP3: &'static str = "MP3"; fn list_cmd_and_args(query: &Query) -> Vec { let mut cmd: Vec = vec![String::from(Self::CMD_LIST)]; @@ -158,7 +164,7 @@ impl LibraryPrivate for Beets { } let split: Vec<&str> = line.split(Self::LIST_FORMAT_SEPARATOR).collect(); - if split.len() != 6 { + if split.len() != 7 { return Err(Error::InvalidData(line.to_string())); } @@ -168,6 +174,7 @@ impl LibraryPrivate for Beets { let track_number = split[3].parse::()?; let track_title = split[4].to_string(); let track_artist = split[5].to_string(); + let track_format = split[6].to_string(); let artist_id = ArtistId { name: album_artist }; @@ -180,6 +187,11 @@ impl LibraryPrivate for Beets { number: track_number, title: track_title, artist: track_artist.split("; ").map(|s| s.to_owned()).collect(), + format: match track_format.as_ref() { + Self::TRACK_FORMAT_FLAC => TrackFormat::Flac, + Self::TRACK_FORMAT_MP3 => TrackFormat::Mp3, + _ => return Err(Error::InvalidData(track_format)), + }, }; let artist = if album_ids.contains_key(&artist_id) { @@ -298,10 +310,14 @@ mod tests { let track_number = &track.number; let track_title = &track.title; let track_artist = &track.artist.join("; "); + let track_format = match track.format { + TrackFormat::Flac => Beets::TRACK_FORMAT_FLAC, + TrackFormat::Mp3 => Beets::TRACK_FORMAT_MP3, + }; strings.push(format!( "{album_artist}{0}{album_year}{0}{album_title}{0}\ - {track_number}{0}{track_title}{0}{track_artist}", + {track_number}{0}{track_title}{0}{track_artist}{0}{track_format}", Beets::LIST_FORMAT_SEPARATOR, )); } diff --git a/tests/files/database/database.json b/tests/files/database/database.json index e60452c..e32a8bc 100644 --- a/tests/files/database/database.json +++ b/tests/files/database/database.json @@ -1 +1 @@ -[{"id":{"name":"Аркона"},"albums":[{"id":{"year":2011,"title":"Slovo"},"tracks":[{"number":1,"title":"Az’","artist":["Аркона"]},{"number":2,"title":"Arkaim","artist":["Аркона"]},{"number":3,"title":"Bol’no mne","artist":["Аркона"]},{"number":4,"title":"Leshiy","artist":["Аркона"]},{"number":5,"title":"Zakliatie","artist":["Аркона"]},{"number":6,"title":"Predok","artist":["Аркона"]},{"number":7,"title":"Nikogda","artist":["Аркона"]},{"number":8,"title":"Tam za tumanami","artist":["Аркона"]},{"number":9,"title":"Potomok","artist":["Аркона"]},{"number":10,"title":"Slovo","artist":["Аркона"]},{"number":11,"title":"Odna","artist":["Аркона"]},{"number":12,"title":"Vo moiom sadochke…","artist":["Аркона"]},{"number":13,"title":"Stenka na stenku","artist":["Аркона"]},{"number":14,"title":"Zimushka","artist":["Аркона"]}]}]},{"id":{"name":"Eluveitie"},"albums":[{"id":{"year":2008,"title":"Slania"},"tracks":[{"number":1,"title":"Samon","artist":["Eluveitie"]},{"number":2,"title":"Primordial Breath","artist":["Eluveitie"]},{"number":3,"title":"Inis Mona","artist":["Eluveitie"]},{"number":4,"title":"Gray Sublime Archon","artist":["Eluveitie"]},{"number":5,"title":"Anagantios","artist":["Eluveitie"]},{"number":6,"title":"Bloodstained Ground","artist":["Eluveitie"]},{"number":7,"title":"The Somber Lay","artist":["Eluveitie"]},{"number":8,"title":"Slanias Song","artist":["Eluveitie"]},{"number":9,"title":"Giamonios","artist":["Eluveitie"]},{"number":10,"title":"Tarvos","artist":["Eluveitie"]},{"number":11,"title":"Calling the Rain","artist":["Eluveitie"]},{"number":12,"title":"Elembivos","artist":["Eluveitie"]}]},{"id":{"year":2004,"title":"Vên [re‐recorded]"},"tracks":[{"number":1,"title":"Verja Urit an Bitus","artist":["Eluveitie"]},{"number":2,"title":"Uis Elveti","artist":["Eluveitie"]},{"number":3,"title":"Ôrô","artist":["Eluveitie"]},{"number":4,"title":"Lament","artist":["Eluveitie"]},{"number":5,"title":"Druid","artist":["Eluveitie"]},{"number":6,"title":"Jêzaïg","artist":["Eluveitie"]}]}]},{"id":{"name":"Frontside"},"albums":[{"id":{"year":2001,"title":"…nasze jest królestwo, potęga i chwała na wieki…"},"tracks":[{"number":1,"title":"Intro = Chaos","artist":["Frontside"]},{"number":2,"title":"Modlitwa","artist":["Frontside"]},{"number":3,"title":"Długa droga z piekła","artist":["Frontside"]},{"number":4,"title":"Synowie ognia","artist":["Frontside"]},{"number":5,"title":"1902","artist":["Frontside"]},{"number":6,"title":"Krew za krew","artist":["Frontside"]},{"number":7,"title":"Kulminacja","artist":["Frontside"]},{"number":8,"title":"Judasz","artist":["Frontside"]},{"number":9,"title":"Więzy","artist":["Frontside"]},{"number":10,"title":"Zagubione dusze","artist":["Frontside"]},{"number":11,"title":"Linia życia","artist":["Frontside"]}]}]},{"id":{"name":"Metallica"},"albums":[{"id":{"year":1984,"title":"Ride the Lightning"},"tracks":[{"number":1,"title":"Fight Fire with Fire","artist":["Metallica"]},{"number":2,"title":"Ride the Lightning","artist":["Metallica"]},{"number":3,"title":"For Whom the Bell Tolls","artist":["Metallica"]},{"number":4,"title":"Fade to Black","artist":["Metallica"]},{"number":5,"title":"Trapped under Ice","artist":["Metallica"]},{"number":6,"title":"Escape","artist":["Metallica"]},{"number":7,"title":"Creeping Death","artist":["Metallica"]},{"number":8,"title":"The Call of Ktulu","artist":["Metallica"]}]},{"id":{"year":1999,"title":"S&M"},"tracks":[{"number":1,"title":"The Ecstasy of Gold","artist":["Metallica"]},{"number":2,"title":"The Call of Ktulu","artist":["Metallica"]},{"number":3,"title":"Master of Puppets","artist":["Metallica"]},{"number":4,"title":"Of Wolf and Man","artist":["Metallica"]},{"number":5,"title":"The Thing That Should Not Be","artist":["Metallica"]},{"number":6,"title":"Fuel","artist":["Metallica"]},{"number":7,"title":"The Memory Remains","artist":["Metallica"]},{"number":8,"title":"No Leaf Clover","artist":["Metallica"]},{"number":9,"title":"Hero of the Day","artist":["Metallica"]},{"number":10,"title":"Devil’s Dance","artist":["Metallica"]},{"number":11,"title":"Bleeding Me","artist":["Metallica"]},{"number":12,"title":"Nothing Else Matters","artist":["Metallica"]},{"number":13,"title":"Until It Sleeps","artist":["Metallica"]},{"number":14,"title":"For Whom the Bell Tolls","artist":["Metallica"]},{"number":15,"title":"−Human","artist":["Metallica"]},{"number":16,"title":"Wherever I May Roam","artist":["Metallica"]},{"number":17,"title":"Outlaw Torn","artist":["Metallica"]},{"number":18,"title":"Sad but True","artist":["Metallica"]},{"number":19,"title":"One","artist":["Metallica"]},{"number":20,"title":"Enter Sandman","artist":["Metallica"]},{"number":21,"title":"Battery","artist":["Metallica"]}]}]}] \ No newline at end of file +[{"id":{"name":"Аркона"},"albums":[{"id":{"year":2011,"title":"Slovo"},"tracks":[{"number":1,"title":"Az’","artist":["Аркона"],"format":"Flac"},{"number":2,"title":"Arkaim","artist":["Аркона"],"format":"Flac"},{"number":3,"title":"Bol’no mne","artist":["Аркона"],"format":"Flac"},{"number":4,"title":"Leshiy","artist":["Аркона"],"format":"Flac"},{"number":5,"title":"Zakliatie","artist":["Аркона"],"format":"Flac"},{"number":6,"title":"Predok","artist":["Аркона"],"format":"Flac"},{"number":7,"title":"Nikogda","artist":["Аркона"],"format":"Flac"},{"number":8,"title":"Tam za tumanami","artist":["Аркона"],"format":"Flac"},{"number":9,"title":"Potomok","artist":["Аркона"],"format":"Flac"},{"number":10,"title":"Slovo","artist":["Аркона"],"format":"Flac"},{"number":11,"title":"Odna","artist":["Аркона"],"format":"Flac"},{"number":12,"title":"Vo moiom sadochke…","artist":["Аркона"],"format":"Flac"},{"number":13,"title":"Stenka na stenku","artist":["Аркона"],"format":"Flac"},{"number":14,"title":"Zimushka","artist":["Аркона"],"format":"Flac"}]}]},{"id":{"name":"Eluveitie"},"albums":[{"id":{"year":2008,"title":"Slania"},"tracks":[{"number":1,"title":"Samon","artist":["Eluveitie"],"format":"Flac"},{"number":2,"title":"Primordial Breath","artist":["Eluveitie"],"format":"Flac"},{"number":3,"title":"Inis Mona","artist":["Eluveitie"],"format":"Flac"},{"number":4,"title":"Gray Sublime Archon","artist":["Eluveitie"],"format":"Flac"},{"number":5,"title":"Anagantios","artist":["Eluveitie"],"format":"Flac"},{"number":6,"title":"Bloodstained Ground","artist":["Eluveitie"],"format":"Flac"},{"number":7,"title":"The Somber Lay","artist":["Eluveitie"],"format":"Flac"},{"number":8,"title":"Slanias Song","artist":["Eluveitie"],"format":"Flac"},{"number":9,"title":"Giamonios","artist":["Eluveitie"],"format":"Flac"},{"number":10,"title":"Tarvos","artist":["Eluveitie"],"format":"Flac"},{"number":11,"title":"Calling the Rain","artist":["Eluveitie"],"format":"Flac"},{"number":12,"title":"Elembivos","artist":["Eluveitie"],"format":"Flac"}]},{"id":{"year":2004,"title":"Vên [re‐recorded]"},"tracks":[{"number":1,"title":"Verja Urit an Bitus","artist":["Eluveitie"],"format":"Flac"},{"number":2,"title":"Uis Elveti","artist":["Eluveitie"],"format":"Flac"},{"number":3,"title":"Ôrô","artist":["Eluveitie"],"format":"Flac"},{"number":4,"title":"Lament","artist":["Eluveitie"],"format":"Flac"},{"number":5,"title":"Druid","artist":["Eluveitie"],"format":"Flac"},{"number":6,"title":"Jêzaïg","artist":["Eluveitie"],"format":"Flac"}]}]},{"id":{"name":"Frontside"},"albums":[{"id":{"year":2001,"title":"…nasze jest królestwo, potęga i chwała na wieki…"},"tracks":[{"number":1,"title":"Intro = Chaos","artist":["Frontside"],"format":"Flac"},{"number":2,"title":"Modlitwa","artist":["Frontside"],"format":"Flac"},{"number":3,"title":"Długa droga z piekła","artist":["Frontside"],"format":"Flac"},{"number":4,"title":"Synowie ognia","artist":["Frontside"],"format":"Flac"},{"number":5,"title":"1902","artist":["Frontside"],"format":"Flac"},{"number":6,"title":"Krew za krew","artist":["Frontside"],"format":"Flac"},{"number":7,"title":"Kulminacja","artist":["Frontside"],"format":"Flac"},{"number":8,"title":"Judasz","artist":["Frontside"],"format":"Flac"},{"number":9,"title":"Więzy","artist":["Frontside"],"format":"Flac"},{"number":10,"title":"Zagubione dusze","artist":["Frontside"],"format":"Flac"},{"number":11,"title":"Linia życia","artist":["Frontside"],"format":"Flac"}]}]},{"id":{"name":"Metallica"},"albums":[{"id":{"year":1984,"title":"Ride the Lightning"},"tracks":[{"number":1,"title":"Fight Fire with Fire","artist":["Metallica"],"format":"Flac"},{"number":2,"title":"Ride the Lightning","artist":["Metallica"],"format":"Flac"},{"number":3,"title":"For Whom the Bell Tolls","artist":["Metallica"],"format":"Flac"},{"number":4,"title":"Fade to Black","artist":["Metallica"],"format":"Flac"},{"number":5,"title":"Trapped under Ice","artist":["Metallica"],"format":"Flac"},{"number":6,"title":"Escape","artist":["Metallica"],"format":"Flac"},{"number":7,"title":"Creeping Death","artist":["Metallica"],"format":"Flac"},{"number":8,"title":"The Call of Ktulu","artist":["Metallica"],"format":"Flac"}]},{"id":{"year":1999,"title":"S&M"},"tracks":[{"number":1,"title":"The Ecstasy of Gold","artist":["Metallica"],"format":"Flac"},{"number":2,"title":"The Call of Ktulu","artist":["Metallica"],"format":"Flac"},{"number":3,"title":"Master of Puppets","artist":["Metallica"],"format":"Flac"},{"number":4,"title":"Of Wolf and Man","artist":["Metallica"],"format":"Flac"},{"number":5,"title":"The Thing That Should Not Be","artist":["Metallica"],"format":"Flac"},{"number":6,"title":"Fuel","artist":["Metallica"],"format":"Flac"},{"number":7,"title":"The Memory Remains","artist":["Metallica"],"format":"Flac"},{"number":8,"title":"No Leaf Clover","artist":["Metallica"],"format":"Flac"},{"number":9,"title":"Hero of the Day","artist":["Metallica"],"format":"Flac"},{"number":10,"title":"Devil’s Dance","artist":["Metallica"],"format":"Flac"},{"number":11,"title":"Bleeding Me","artist":["Metallica"],"format":"Flac"},{"number":12,"title":"Nothing Else Matters","artist":["Metallica"],"format":"Flac"},{"number":13,"title":"Until It Sleeps","artist":["Metallica"],"format":"Flac"},{"number":14,"title":"For Whom the Bell Tolls","artist":["Metallica"],"format":"Flac"},{"number":15,"title":"−Human","artist":["Metallica"],"format":"Flac"},{"number":16,"title":"Wherever I May Roam","artist":["Metallica"],"format":"Flac"},{"number":17,"title":"Outlaw Torn","artist":["Metallica"],"format":"Flac"},{"number":18,"title":"Sad but True","artist":["Metallica"],"format":"Flac"},{"number":19,"title":"One","artist":["Metallica"],"format":"Flac"},{"number":20,"title":"Enter Sandman","artist":["Metallica"],"format":"Flac"},{"number":21,"title":"Battery","artist":["Metallica"],"format":"Flac"}]}]}] \ No newline at end of file diff --git a/tests/lib.rs b/tests/lib.rs index c749926..e7a9f61 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -1,7 +1,7 @@ mod database; mod library; -use musichoard::{Album, AlbumId, Artist, ArtistId, Track}; +use musichoard::{Album, AlbumId, Artist, ArtistId, Track, TrackFormat}; use once_cell::sync::Lazy; static COLLECTION: Lazy> = Lazy::new(|| { @@ -20,71 +20,85 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("Az’"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("Arkaim"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("Bol’no mne"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Leshiy"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("Zakliatie"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Predok"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 07, title: String::from("Nikogda"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 08, title: String::from("Tam za tumanami"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 09, title: String::from("Potomok"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 10, title: String::from("Slovo"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 11, title: String::from("Odna"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 12, title: String::from("Vo moiom sadochke…"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 13, title: String::from("Stenka na stenku"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, Track { number: 14, title: String::from("Zimushka"), artist: vec![String::from("Аркона")], + format: TrackFormat::Flac, }, ], }], @@ -104,61 +118,73 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("Samon"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("Primordial Breath"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("Inis Mona"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Gray Sublime Archon"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("Anagantios"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Bloodstained Ground"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 07, title: String::from("The Somber Lay"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 08, title: String::from("Slanias Song"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 09, title: String::from("Giamonios"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 10, title: String::from("Tarvos"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 11, title: String::from("Calling the Rain"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 12, title: String::from("Elembivos"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, ], }, @@ -172,31 +198,37 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("Verja Urit an Bitus"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("Uis Elveti"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("Ôrô"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Lament"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("Druid"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Jêzaïg"), artist: vec![String::from("Eluveitie")], + format: TrackFormat::Flac, }, ], }, @@ -216,56 +248,67 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("Intro = Chaos"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("Modlitwa"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("Długa droga z piekła"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Synowie ognia"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("1902"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Krew za krew"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 07, title: String::from("Kulminacja"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 08, title: String::from("Judasz"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 09, title: String::from("Więzy"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 10, title: String::from("Zagubione dusze"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, Track { number: 11, title: String::from("Linia życia"), artist: vec![String::from("Frontside")], + format: TrackFormat::Flac, }, ], }], @@ -285,41 +328,49 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("Fight Fire with Fire"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("Ride the Lightning"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("For Whom the Bell Tolls"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Fade to Black"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("Trapped under Ice"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Escape"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 07, title: String::from("Creeping Death"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 08, title: String::from("The Call of Ktulu"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, ], }, @@ -333,106 +384,127 @@ static COLLECTION: Lazy> = Lazy::new(|| { number: 01, title: String::from("The Ecstasy of Gold"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 02, title: String::from("The Call of Ktulu"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 03, title: String::from("Master of Puppets"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 04, title: String::from("Of Wolf and Man"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 05, title: String::from("The Thing That Should Not Be"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 06, title: String::from("Fuel"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 07, title: String::from("The Memory Remains"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 08, title: String::from("No Leaf Clover"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 09, title: String::from("Hero of the Day"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 10, title: String::from("Devil’s Dance"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 11, title: String::from("Bleeding Me"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 12, title: String::from("Nothing Else Matters"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 13, title: String::from("Until It Sleeps"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 14, title: String::from("For Whom the Bell Tolls"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 15, title: String::from("−Human"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 16, title: String::from("Wherever I May Roam"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 17, title: String::from("Outlaw Torn"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 18, title: String::from("Sad but True"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 19, title: String::from("One"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 20, title: String::from("Enter Sandman"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, Track { number: 21, title: String::from("Battery"), artist: vec![String::from("Metallica")], + format: TrackFormat::Flac, }, ], },