diff --git a/src/core/collection/album.rs b/src/core/collection/album.rs index e5d0033..bb128e0 100644 --- a/src/core/collection/album.rs +++ b/src/core/collection/album.rs @@ -137,6 +137,25 @@ pub enum AlbumSecondaryType { FieldRecording, } +impl AlbumSecondaryType { + pub fn all_variants() -> [AlbumSecondaryType; 12] { + [ + AlbumSecondaryType::Compilation, + AlbumSecondaryType::Soundtrack, + AlbumSecondaryType::Spokenword, + AlbumSecondaryType::Interview, + AlbumSecondaryType::Audiobook, + AlbumSecondaryType::AudioDrama, + AlbumSecondaryType::Live, + AlbumSecondaryType::Remix, + AlbumSecondaryType::DjMix, + AlbumSecondaryType::MixtapeStreet, + AlbumSecondaryType::Demo, + AlbumSecondaryType::FieldRecording, + ] + } +} + /// The album's ownership status. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum AlbumOwnership { diff --git a/src/main.rs b/src/main.rs index 502a2be..c3cb2be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,20 +85,11 @@ fn default_filter() -> CollectionFilter { ]], except: vec![ vec![AlbumField::Ownership(AlbumOwnership::None)], - vec![ - AlbumField::SecondaryType(AlbumSecondaryType::Compilation), - AlbumField::SecondaryType(AlbumSecondaryType::Soundtrack), - AlbumField::SecondaryType(AlbumSecondaryType::Spokenword), - AlbumField::SecondaryType(AlbumSecondaryType::Interview), - AlbumField::SecondaryType(AlbumSecondaryType::Audiobook), - AlbumField::SecondaryType(AlbumSecondaryType::AudioDrama), - AlbumField::SecondaryType(AlbumSecondaryType::Live), - AlbumField::SecondaryType(AlbumSecondaryType::Remix), - AlbumField::SecondaryType(AlbumSecondaryType::DjMix), - AlbumField::SecondaryType(AlbumSecondaryType::MixtapeStreet), - AlbumField::SecondaryType(AlbumSecondaryType::Demo), - AlbumField::SecondaryType(AlbumSecondaryType::FieldRecording), - ], + AlbumSecondaryType::all_variants() + .iter() + .cloned() + .map(AlbumField::SecondaryType) + .collect(), ], } }