mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2025-03-04 14:57:17 +00:00
Add missing title methods to Album
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
a9b78c7aa0
commit
c673c7fcbb
3 changed files with 16 additions and 9 deletions
|
@ -8,7 +8,12 @@ use byteorder::{LittleEndian, ReadBytesExt};
|
|||
use ogg_pager::Page;
|
||||
use unicase::UniCase;
|
||||
|
||||
pub type OGGTags = (String, Vec<Picture>, HashMap<UniCase<String>, String>, OggFormat);
|
||||
pub type OGGTags = (
|
||||
String,
|
||||
Vec<Picture>,
|
||||
HashMap<UniCase<String>, String>,
|
||||
OggFormat,
|
||||
);
|
||||
|
||||
pub(crate) fn read_from<T>(
|
||||
mut data: T,
|
||||
|
|
|
@ -175,7 +175,9 @@ impl OggTag {
|
|||
where
|
||||
V: Into<String>,
|
||||
{
|
||||
self.inner.comments.insert(UniCase::from(key.to_string()), val.into());
|
||||
self.inner
|
||||
.comments
|
||||
.insert(UniCase::from(key.to_string()), val.into());
|
||||
}
|
||||
|
||||
fn remove_key(&mut self, key: &str) {
|
||||
|
|
|
@ -34,13 +34,13 @@ impl<'a> Album<'a> {
|
|||
covers,
|
||||
}
|
||||
}
|
||||
/// Create a new album with the specified title
|
||||
pub fn with_title(title: &'a str) -> Self {
|
||||
Self {
|
||||
title: Some(title),
|
||||
artist: None,
|
||||
covers: (None, None),
|
||||
}
|
||||
/// Sets the album title
|
||||
pub fn set_title(&mut self, title: &'a str) {
|
||||
self.title = Some(title)
|
||||
}
|
||||
/// Clears the `title` field
|
||||
pub fn remove_title(&mut self) {
|
||||
self.title = None
|
||||
}
|
||||
/// Set the album artists
|
||||
pub fn set_artist(&mut self, artist_str: &'a str) {
|
||||
|
|
Loading…
Add table
Reference in a new issue