Add missing title methods to Album

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
Serial 2021-07-10 19:59:56 -04:00
parent a9b78c7aa0
commit c673c7fcbb
3 changed files with 16 additions and 9 deletions

View file

@ -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,

View file

@ -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) {

View file

@ -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) {