mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Remove add_artist and add_album_artist
These were useless methods that shouldn't be handled by lofty anyway
This commit is contained in:
parent
df2e728974
commit
e5231567cc
2 changed files with 4 additions and 28 deletions
|
@ -67,8 +67,8 @@ impl<'a> From<AnyTag<'a>> for Mp4Tag {
|
|||
if let Some(v) = inp.title() {
|
||||
tag.set_title(v)
|
||||
}
|
||||
if let Some(i) = inp.artists() {
|
||||
i.iter().for_each(|&a| tag.add_artist(a))
|
||||
if let Some(i) = inp.artists_as_string() {
|
||||
tag.set_artist(&*i)
|
||||
}
|
||||
if let Some(v) = inp.year {
|
||||
tag.set_year(v)
|
||||
|
@ -76,8 +76,8 @@ impl<'a> From<AnyTag<'a>> for Mp4Tag {
|
|||
if let Some(v) = inp.album().title {
|
||||
tag.set_album_title(v)
|
||||
}
|
||||
if let Some(i) = inp.album().artists {
|
||||
i.iter().for_each(|&a| tag.add_album_artist(a))
|
||||
if let Some(i) = inp.album().artists_as_string() {
|
||||
tag.set_album_artist(&*i)
|
||||
}
|
||||
if let Some(v) = inp.track_number() {
|
||||
tag.set_track_number(v)
|
||||
|
@ -130,10 +130,6 @@ impl AudioTagEdit for Mp4Tag {
|
|||
self.0.set_artist(artist)
|
||||
}
|
||||
|
||||
fn add_artist(&mut self, artist: &str) {
|
||||
self.0.add_artist(artist);
|
||||
}
|
||||
|
||||
fn remove_artist(&mut self) {
|
||||
self.0.remove_artists();
|
||||
}
|
||||
|
@ -176,10 +172,6 @@ impl AudioTagEdit for Mp4Tag {
|
|||
self.0.set_album_artist(artists)
|
||||
}
|
||||
|
||||
fn add_album_artist(&mut self, artist: &str) {
|
||||
self.0.add_album_artist(artist)
|
||||
}
|
||||
|
||||
fn remove_album_artists(&mut self) {
|
||||
self.0.remove_data(&FourCC(*b"aART"));
|
||||
self.0.remove_album_artists();
|
||||
|
|
|
@ -15,14 +15,6 @@ pub trait AudioTagEdit {
|
|||
|
||||
fn artist_str(&self) -> Option<&str>;
|
||||
fn set_artist(&mut self, artist: &str);
|
||||
fn add_artist(&mut self, artist: &str) {
|
||||
if let Some(mut artists) = self.artists_vec() {
|
||||
artists.push(artist);
|
||||
self.set_artist(&artists.join("/"))
|
||||
} else {
|
||||
self.set_artist(artist)
|
||||
}
|
||||
}
|
||||
|
||||
fn artists_vec(&self) -> Option<Vec<&str>> {
|
||||
self.artist_str().map(|a| a.split('/').collect())
|
||||
|
@ -50,14 +42,6 @@ pub trait AudioTagEdit {
|
|||
self.album_artist_str().map(|a| a.split('/').collect())
|
||||
}
|
||||
fn set_album_artist(&mut self, artist: &str);
|
||||
fn add_album_artist(&mut self, artist: &str) {
|
||||
if let Some(mut artists) = self.album_artists_vec() {
|
||||
artists.push(artist);
|
||||
self.set_album_artist(&artists.join("/"))
|
||||
} else {
|
||||
self.set_album_artist(artist)
|
||||
}
|
||||
}
|
||||
fn remove_album_artists(&mut self);
|
||||
|
||||
fn album_cover(&self) -> Option<Picture>;
|
||||
|
|
Loading…
Reference in a new issue