mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-14 06:32:33 +00:00
Fix and complete work/movement support
This commit is contained in:
parent
d08d76616e
commit
0616da11fb
3 changed files with 40 additions and 2 deletions
|
@ -316,6 +316,17 @@ impl From<ApeTag> for Tag {
|
|||
{
|
||||
continue
|
||||
},
|
||||
(ItemKey::MovementNumber | ItemKey::MovementTotal, ItemValue::Text(val))
|
||||
if split_pair(
|
||||
val,
|
||||
&mut tag,
|
||||
ItemKey::MovementNumber,
|
||||
ItemKey::MovementTotal,
|
||||
)
|
||||
.is_some() =>
|
||||
{
|
||||
continue
|
||||
},
|
||||
(k, _) => tag.items.push(TagItem::new(k, item.value)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -543,6 +543,17 @@ impl From<ID3v2Tag> for Tag {
|
|||
{
|
||||
continue
|
||||
},
|
||||
("MVIN", FrameValue::Text { value: content, .. })
|
||||
if split_pair(
|
||||
&content,
|
||||
&mut tag,
|
||||
ItemKey::MovementNumber,
|
||||
ItemKey::MovementTotal,
|
||||
)
|
||||
.is_some() =>
|
||||
{
|
||||
continue
|
||||
},
|
||||
// Store TXXX/WXXX frames by their descriptions, rather than their IDs
|
||||
(
|
||||
"TXXX",
|
||||
|
|
|
@ -78,6 +78,10 @@ gen_map!(
|
|||
"Grouping" => ContentGroup,
|
||||
"Title" => TrackTitle,
|
||||
"Subtitle" => TrackSubtitle,
|
||||
"WORKTITLE" => Work,
|
||||
"MOVEMENTNAME" => Movement,
|
||||
"MOVEMENT" => MovementNumber,
|
||||
"MOVEMENTTOTAL" => MovementTotal,
|
||||
"ALBUMSORT" => AlbumTitleSortOrder,
|
||||
"ALBUMARTISTSORT" => AlbumArtistSortOrder,
|
||||
"TITLESORT" => TrackTitleSortOrder,
|
||||
|
@ -162,8 +166,10 @@ gen_map!(
|
|||
"TDRC" => RecordingDate,
|
||||
"TDOR" => OriginalReleaseDate,
|
||||
"TSRC" => ISRC,
|
||||
"WORK" => Work, // ID3v2.4: TXXX:WORK (Apple uses TIT1/ContentGroup, see GRP1/AppleId3v2ContentGroup for disambiguation)
|
||||
"MVNM" => Movement,
|
||||
"MVIN" => MovementIndex,
|
||||
"MVIN" => MovementNumber,
|
||||
"MVIN" => MovementTotal,
|
||||
"TCMP" => FlagCompilation,
|
||||
"PCST" => FlagPodcast,
|
||||
"TFLT" => FileType,
|
||||
|
@ -214,6 +220,10 @@ gen_map!(
|
|||
"\u{a9}grp" => ContentGroup,
|
||||
"\u{a9}nam" => TrackTitle,
|
||||
"----:com.apple.iTunes:SUBTITLE" => TrackSubtitle,
|
||||
"\u{a9}wrk" => Work,
|
||||
"\u{a9}mvn" => Movement,
|
||||
"\u{a9}mvi" => MovementNumber,
|
||||
"\u{a9}mvc" => MovementTotal,
|
||||
"soal" => AlbumTitleSortOrder,
|
||||
"soaa" => AlbumArtistSortOrder,
|
||||
"sonm" => TrackTitleSortOrder,
|
||||
|
@ -302,6 +312,10 @@ gen_map!(
|
|||
"GROUPING" => ContentGroup,
|
||||
"TITLE" => TrackTitle,
|
||||
"SUBTITLE" => TrackSubtitle,
|
||||
"WORK" => Work,
|
||||
"MOVEMENTNAME" => Movement,
|
||||
"MOVEMENT" => MovementNumber,
|
||||
"MOVEMENTTOTAL" => MovementTotal,
|
||||
"ALBUMSORT" => AlbumTitleSortOrder,
|
||||
"ALBUMARTISTSORT" => AlbumArtistSortOrder,
|
||||
"TITLESORT" => TrackTitleSortOrder,
|
||||
|
@ -496,8 +510,10 @@ gen_item_keys!(
|
|||
ISRC,
|
||||
Barcode,
|
||||
CatalogNumber,
|
||||
Work,
|
||||
Movement,
|
||||
MovementIndex,
|
||||
MovementNumber,
|
||||
MovementTotal,
|
||||
|
||||
// Flags
|
||||
FlagCompilation,
|
||||
|
|
Loading…
Reference in a new issue