Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **ItemKey**: `ItemKey::AlbumArtists`, available for ID3v2, Vorbis Comments, APE, and MP4 Ilst ([PR](https://github.com/Serial-ATA/lofty-rs/pull/523))
- This is a multi-value item that stores each artist for a track. It should be retrieved with `Tag::get_strings` or `Tag::take_strings`.
- For example, a track has `ItemKey::TrackArtist` = "Foo & Bar", then `ItemKey::AlbumArtists` = ["Foo", "Bar"].
- **Serde**: [Serde] support for `*Type` enums (`FileType`, `TagType`, `PictureType`)
- Support can be enabled with the new `serde` feature (not enabled by default)

### Changed
- **ID3v2**: Check `TXXX:ALBUMARTIST` and `TXXX:ALBUM ARTIST` for `ItemKey::AlbumArtist` conversions
Expand Down Expand Up @@ -1012,5 +1014,6 @@ See [ogg_pager's changelog](ogg_pager/CHANGELOG.md).
[0.5.1]: https://github.com/Serial-ATA/lofty-rs/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/Serial-ATA/lofty-rs/compare/64f0eff...0.5.0

[serde]: https://docs.rs/serde
[TagLib]: https://github.com/taglib/taglib
[ogg_pager's changelog]: ogg_pager/CHANGELOG.md
6 changes: 6 additions & 0 deletions lofty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ paste = "1.0.15"
[features]
default = ["id3v2_compression_support"]
id3v2_compression_support = ["dep:flate2"]
serde = ["dep:serde"]

[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true

[dev-dependencies]
# WAV properties validity tests
Expand Down
2 changes: 2 additions & 0 deletions lofty/src/file/file_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use std::ffi::OsStr;
use std::path::Path;

/// The type of file read
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
#[allow(clippy::unsafe_derive_deserialize)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum FileType {
Expand Down
2 changes: 2 additions & 0 deletions lofty/src/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ impl Display for MimeType {

/// The picture type, according to ID3v2 APIC
#[allow(missing_docs)]
#[allow(clippy::unsafe_derive_deserialize)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[non_exhaustive]
pub enum PictureType {
Expand Down
2 changes: 2 additions & 0 deletions lofty/src/tag/tag_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use std::fs::OpenOptions;
use std::path::Path;

/// The tag's format
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[allow(clippy::unsafe_derive_deserialize)]
#[non_exhaustive]
pub enum TagType {
/// This covers both APEv1 and APEv2 as it doesn't matter much
Expand Down