tape: add Inventory.media_list() helper

This commit is contained in:
Dietmar Maurer 2021-03-01 09:30:45 +01:00
parent 955f4aefcd
commit d984a9acf0
1 changed files with 5 additions and 0 deletions

View File

@ -230,6 +230,11 @@ impl Inventory {
self.map.get(uuid).map(|entry| &entry.id)
}
/// List all media Uuids
pub fn media_list(&self) -> Vec<&Uuid> {
self.map.keys().collect()
}
/// find media by label_text
pub fn find_media_by_label_text(&self, label_text: &str) -> Option<&MediaId> {
self.map.values().find_map(|entry| {