Formatting

This commit is contained in:
Antoine Gersant 2016-12-03 16:27:33 -08:00
parent 089088d1ee
commit 10c234e92f

View file

@ -556,7 +556,7 @@ impl Index {
output.push(CollectionFile::Directory(directory)); output.push(CollectionFile::Directory(directory));
} }
// Browse sub-directory // Browse sub-directory
} else { } else {
let real_path = self.vfs.virtual_to_real(virtual_path)?; let real_path = self.vfs.virtual_to_real(virtual_path)?;
let directories = self.browse_directories(real_path.as_path())?; let directories = self.browse_directories(real_path.as_path())?;
@ -591,9 +591,7 @@ fn _get_test_index(name: &str) -> Index {
let mut mount_points = HashMap::new(); let mut mount_points = HashMap::new();
mount_points.insert("root".to_owned(), collection_path); mount_points.insert("root".to_owned(), collection_path);
let vfs = Arc::new(Vfs::new(VfsConfig { let vfs = Arc::new(Vfs::new(VfsConfig { mount_points: mount_points }));
mount_points: mount_points,
}));
let mut index_config = IndexConfig::new(); let mut index_config = IndexConfig::new();
index_config.album_art_pattern = Some(Regex::new(r#"^Folder\.(png|jpg|jpeg)$"#).unwrap()); index_config.album_art_pattern = Some(Regex::new(r#"^Folder\.(png|jpg|jpeg)$"#).unwrap());
@ -632,17 +630,18 @@ fn test_metadata() {
let results = index.browse(target.as_path()).unwrap(); let results = index.browse(target.as_path()).unwrap();
assert_eq!(results.len(), 7); assert_eq!(results.len(), 7);
assert_eq!(results[4], CollectionFile::Song(Song{ assert_eq!(results[4],
path: song_path.to_str().unwrap().to_string(), CollectionFile::Song(Song {
track_number: Some(5), path: song_path.to_str().unwrap().to_string(),
disc_number: None, track_number: Some(5),
title: Some("シャーベット (Sherbet)".to_owned()), disc_number: None,
artist: Some("Tobokegao".to_owned()), title: Some("シャーベット (Sherbet)".to_owned()),
album_artist: None, artist: Some("Tobokegao".to_owned()),
album: Some("Picnic".to_owned()), album_artist: None,
year: Some(2016), album: Some("Picnic".to_owned()),
artwork: Some(artwork_path.to_str().unwrap().to_string()), year: Some(2016),
})); artwork: Some(artwork_path.to_str().unwrap().to_string()),
}));
} }
#[test] #[test]