mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2025-01-05 16:58:45 +00:00
ID3v1: Improve Tag
conversion docs
This commit is contained in:
parent
7745c682a8
commit
657cab6726
1 changed files with 21 additions and 3 deletions
|
@ -45,12 +45,30 @@ macro_rules! impl_accessor {
|
||||||
///
|
///
|
||||||
/// ## Conversions
|
/// ## Conversions
|
||||||
///
|
///
|
||||||
|
/// ### To `Tag`
|
||||||
|
///
|
||||||
|
/// All fields can be translated to a `TagItem`:
|
||||||
|
///
|
||||||
|
/// * `title` -> [`ItemKey::TrackTitle`]
|
||||||
|
/// * `artist` -> [`ItemKey::TrackArtist`]
|
||||||
|
/// * `album` -> [`ItemKey::AlbumTitle`]
|
||||||
|
/// * `year` -> [`ItemKey::Year`]
|
||||||
|
/// * `comment` -> [`ItemKey::Comment`]
|
||||||
|
/// * `track_number` -> [`ItemKey::TrackNumber`]
|
||||||
|
/// * `genre` -> [`ItemKey::Genre`] (As long as the genre is a valid index into [`GENRES`])
|
||||||
|
///
|
||||||
|
///
|
||||||
/// ### From `Tag`
|
/// ### From `Tag`
|
||||||
///
|
///
|
||||||
/// Two checks are performed when converting a genre:
|
/// All of the [`ItemKey`]s referenced in the conversion to [`Tag`] will be checked.
|
||||||
///
|
///
|
||||||
/// * [`GENRES`] contains the string
|
/// The values will be used as-is, with two exceptions:
|
||||||
/// * The [`ItemValue`](crate::ItemValue) can be parsed into a `u8`
|
///
|
||||||
|
/// * [`ItemKey::TrackNumber`] - Will only be used if the value can be parsed as a `u8`
|
||||||
|
/// * [`ItemKey::Genre`] - Will only be used if:
|
||||||
|
///
|
||||||
|
/// [`GENRES`] contains the string **OR** The [`ItemValue`](crate::ItemValue) can be parsed into
|
||||||
|
/// a `u8` ***and*** it is a valid index into [`GENRES`]
|
||||||
#[derive(Default, Debug, PartialEq, Eq, Clone)]
|
#[derive(Default, Debug, PartialEq, Eq, Clone)]
|
||||||
#[tag(
|
#[tag(
|
||||||
description = "An ID3v1 tag",
|
description = "An ID3v1 tag",
|
||||||
|
|
Loading…
Reference in a new issue