diff --git a/src/components/tags/ape_tag.rs b/src/components/tags/ape_tag.rs index f368079a..9333726c 100644 --- a/src/components/tags/ape_tag.rs +++ b/src/components/tags/ape_tag.rs @@ -75,6 +75,7 @@ impl AudioTagEdit for ApeTag { get_set_methods!(lyricist, "Lyricist"); get_set_methods!(composer, "Composer"); get_set_methods!(album_title, "Album"); + get_set_methods!(encoder, "Encoder"); // Album artists aren't standard? get_set_methods!(album_artist, "Album artist"); diff --git a/src/components/tags/id3_tag.rs b/src/components/tags/id3_tag.rs index daf796db..ea139fe2 100644 --- a/src/components/tags/id3_tag.rs +++ b/src/components/tags/id3_tag.rs @@ -206,6 +206,20 @@ impl AudioTagEdit for Id3v2Tag { self.inner.remove("TCOM") } + fn encoder(&self) -> Option<&str> { + if let Some(frame) = self.inner.get("TSSE") { + return frame.content().text(); + } + + None + } + fn set_encoder(&mut self, encoder: &str) { + self.inner.set_text("TSSE", encoder) + } + fn remove_encoder(&mut self) { + self.inner.remove("TSSE") + } + fn album_title(&self) -> Option<&str> { self.inner.album() } diff --git a/src/components/tags/mp4_tag.rs b/src/components/tags/mp4_tag.rs index 70388e68..150c60bc 100644 --- a/src/components/tags/mp4_tag.rs +++ b/src/components/tags/mp4_tag.rs @@ -135,6 +135,16 @@ impl AudioTagEdit for Mp4Tag { self.inner.remove_lyricists() } + fn encoder(&self) -> Option<&str> { + self.inner.encoder() + } + fn set_encoder(&mut self, encoder: &str) { + self.inner.set_encoder(encoder) + } + fn remove_encoder(&mut self) { + self.inner.remove_encoder() + } + fn album_title(&self) -> Option<&str> { self.inner.album() } diff --git a/src/components/tags/ogg_tag.rs b/src/components/tags/ogg_tag.rs index ccc02e36..39f0e0f6 100644 --- a/src/components/tags/ogg_tag.rs +++ b/src/components/tags/ogg_tag.rs @@ -192,6 +192,7 @@ impl AudioTagEdit for OggTag { get_set_methods!(composer, "COMPOSER"); get_set_methods!(album_title, "ALBUM"); get_set_methods!(album_artist, "ALBUMARTIST"); + get_set_methods!(encoder, "ENCODER"); fn date(&self) -> Option { self.get_value("DATE").map(std::string::ToString::to_string) diff --git a/src/components/tags/riff_tag.rs b/src/components/tags/riff_tag.rs index fe292bfa..a927f00f 100644 --- a/src/components/tags/riff_tag.rs +++ b/src/components/tags/riff_tag.rs @@ -62,6 +62,7 @@ impl AudioTagEdit for RiffTag { get_set_methods!(copyright, "ICOP"); get_set_methods!(genre, "IGNR"); get_set_methods!(album_title, "IPRD"); + get_set_methods!(encoder, "ISFT"); fn date(&self) -> Option { self.get_value("ICRD").map(std::string::ToString::to_string) diff --git a/src/traits.rs b/src/traits.rs index 7fd1ba1a..b9f1ec70 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -42,6 +42,8 @@ pub trait AudioTagEdit { str_accessor!(lyricist); str_accessor!(composer); + str_accessor!(encoder); + /// Returns the track's [`Album`] fn album(&self) -> Album<'_> { Album {