ID3v2: Export TextEncoding in crate root

This commit is contained in:
Serial 2022-10-14 07:59:42 -04:00
parent be6662ea90
commit b2da52196a
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
6 changed files with 9 additions and 8 deletions

View file

@ -17,7 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Error**: `ErrorKind::SizeMismatch`
### Changed
- **ID3v2**: Frame/tag flags with optional additional data are now `Option<T>` instead of `(bool, T)`
- **ID3v2**:
- Frame/tag flags with optional additional data are now `Option<T>` instead of `(bool, T)`
- `id3::v2::TextEncoding` is now exported as `lofty::TextEncoding`
- `read_from{_path}` will no longer take a `bool` for reading properties, and will do it by default. To
change this behavior, you must now use `Probe`.
- **FileType**: `primary_tag_type` will no longer change its return depending on the enabled features.

View file

@ -21,8 +21,6 @@ use byteorder::{BigEndian, ByteOrder, ReadBytesExt};
cfg_if::cfg_if! {
if #[cfg(feature = "id3v2")] {
pub use flags::ID3v2TagFlags;
// TODO: remove
pub use crate::util::text::TextEncoding;
pub use util::upgrade::{upgrade_v2, upgrade_v3};
pub(crate) mod tag;

View file

@ -66,7 +66,7 @@ pub struct TagRestrictions {
/// Text encoding restrictions
///
/// `false` - No restrictions
/// `true` - Strings are only encoded with [`TextEncoding::Latin1`](crate::id3::v2::TextEncoding::Latin1) or [`TextEncoding::UTF8`](crate::id3::v2::TextEncoding::UTF8)
/// `true` - Strings are only encoded with [`TextEncoding::Latin1`](crate::TextEncoding::Latin1) or [`TextEncoding::UTF8`](crate::TextEncoding::UTF8)
pub text_encoding: bool,
/// Restrictions on all text field sizes. See [`TextSizeRestrictions`]
pub text_fields_size: TextSizeRestrictions,

View file

@ -193,6 +193,7 @@ pub use crate::picture::{MimeType, Picture, PictureType};
pub use crate::properties::FileProperties;
pub use crate::tag::{Tag, TagType};
pub use tag::item::{ItemKey, ItemValue, TagItem};
pub use util::text::TextEncoding;
pub use crate::traits::{Accessor, TagExt};

View file

@ -1,5 +1,5 @@
use lofty::id3::v2::{ID3v2Version, TextEncoding};
use lofty::{Picture, PictureInformation, PictureType};
use lofty::id3::v2::ID3v2Version;
use lofty::{Picture, PictureInformation, PictureType, TextEncoding};
use std::fs::File;
use std::io::Read;

View file

@ -1,7 +1,7 @@
// Tests for special case conversions
use lofty::id3::v2::{Frame, FrameFlags, FrameValue, ID3v2Tag, LanguageFrame, TextEncoding};
use lofty::{ItemKey, Tag, TagType};
use lofty::id3::v2::{Frame, FrameFlags, FrameValue, ID3v2Tag, LanguageFrame};
use lofty::{ItemKey, Tag, TagType, TextEncoding};
#[test]
fn tag_to_id3v2_lang_frame() {