Add convenience method
This commit is contained in:
parent
8a42f7c712
commit
e9b169fdef
@ -137,6 +137,25 @@ pub enum AlbumSecondaryType {
|
|||||||
FieldRecording,
|
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.
|
/// The album's ownership status.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
pub enum AlbumOwnership {
|
pub enum AlbumOwnership {
|
||||||
|
19
src/main.rs
19
src/main.rs
@ -85,20 +85,11 @@ fn default_filter() -> CollectionFilter {
|
|||||||
]],
|
]],
|
||||||
except: vec![
|
except: vec![
|
||||||
vec![AlbumField::Ownership(AlbumOwnership::None)],
|
vec![AlbumField::Ownership(AlbumOwnership::None)],
|
||||||
vec![
|
AlbumSecondaryType::all_variants()
|
||||||
AlbumField::SecondaryType(AlbumSecondaryType::Compilation),
|
.iter()
|
||||||
AlbumField::SecondaryType(AlbumSecondaryType::Soundtrack),
|
.cloned()
|
||||||
AlbumField::SecondaryType(AlbumSecondaryType::Spokenword),
|
.map(AlbumField::SecondaryType)
|
||||||
AlbumField::SecondaryType(AlbumSecondaryType::Interview),
|
.collect(),
|
||||||
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),
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user