Skip to content

Commit bf44f1c

Browse files
committed
ItemKey: Add variants for AcoustID
1 parent 165fb11 commit bf44f1c

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- `ItemKey::ReleaseCountry` ([PR](https://github.com/Serial-ATA/lofty-rs/pull/573))
1919
- Currently, this maps to the [fields](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#id30) used by MusicBrainz Picard, which expect an
2020
ISO 3166-1 code.
21-
- **Serde**: [Serde] support for `*Type` enums (`FileType`, `TagType`, `PictureType`)
21+
- `ItemKey::AcoustId` and `ItemKey::AcoustIdFingerprint` ([issue](https://github.com/Serial-ATA/lofty-rs/issues/455)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/575))
22+
- These two fields come from [AcoustID], and can appear multiple times in a single tag.
23+
- **Serde**: [Serde] support for `*Type` enums (`FileType`, `TagType`, `PictureType`) ([issue](https://github.com/Serial-ATA/lofty-rs/issues/533)) ([PR](https://github.com/Serial-ATA/lofty-rs/pull/534))
2224
- Support can be enabled with the new `serde` feature (not enabled by default)
2325
- **Probe**: `Probe::read_bound()` ([PR](https://github.com/Serial-ATA/lofty-rs/pull/557))
2426
- Same as `Probe::read()`, but returns a [`BoundTaggedFile`](https://docs.rs/lofty/latest/lofty/file/struct.BoundTaggedFile.html)
@@ -1049,4 +1051,5 @@ See [ogg_pager's changelog](ogg_pager/CHANGELOG.md).
10491051

10501052
[serde]: https://docs.rs/serde
10511053
[TagLib]: https://github.com/taglib/taglib
1054+
[AcoustID]: https://acoustid.org/
10521055
[ogg_pager's changelog]: ogg_pager/CHANGELOG.md

lofty/src/id3/v2/tag.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,8 @@ impl MergeTag for SplitTagRemainder {
14161416
for item_key in [
14171417
ItemKey::TrackArtists,
14181418
ItemKey::Director,
1419+
ItemKey::AcoustId,
1420+
ItemKey::AcoustIdFingerprint,
14191421
ItemKey::CatalogNumber,
14201422
ItemKey::MusicBrainzArtistId,
14211423
ItemKey::MusicBrainzReleaseArtistId,

lofty/src/tag/item.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ gen_map!(
131131
"RELEASEDATE" => ReleaseDate,
132132
"ISRC" => Isrc,
133133
"Barcode" => Barcode,
134+
"ACOUSTID_ID" => AcoustId,
135+
"ACOUSTID_FINGERPRINT" => AcoustIdFingerprint,
134136
"CatalogNumber" => CatalogNumber,
135137
"Compilation" => FlagCompilation,
136138
"Media" => OriginalMediaType,
@@ -199,6 +201,8 @@ gen_map!(
199201
"TDOR" => OriginalReleaseDate,
200202
"TSRC" => Isrc,
201203
"BARCODE" => Barcode,
204+
"Acoustid Id" => AcoustId,
205+
"Acoustid Fingerprint" => AcoustIdFingerprint,
202206
"CATALOGNUMBER" => CatalogNumber,
203207
"WORK" => Work, // ID3v2.4: TXXX:WORK (Apple uses TIT1/ContentGroup, see GRP1/AppleId3v2ContentGroup for disambiguation)
204208
"MVNM" => Movement,
@@ -300,6 +304,8 @@ gen_map!(
300304
"----:com.apple.iTunes:RELEASEDATE" => ReleaseDate,
301305
"----:com.apple.iTunes:ISRC" => Isrc,
302306
"----:com.apple.iTunes:BARCODE" => Barcode,
307+
"----:com.apple.iTunes:Acoustid Id" => AcoustId,
308+
"----:com.apple.iTunes:Acoustid Fingerprint" => AcoustIdFingerprint,
303309
"----:com.apple.iTunes:CATALOGNUMBER" => CatalogNumber,
304310
"cpil" => FlagCompilation,
305311
"pcst" => FlagPodcast,
@@ -411,6 +417,8 @@ gen_map!(
411417
"RELEASEDATE" => ReleaseDate,
412418
"ISRC" => Isrc,
413419
"BARCODE" => Barcode,
420+
"ACOUSTID_ID" => AcoustId,
421+
"ACOUSTID_FINGERPRINT" => AcoustIdFingerprint,
414422
"CATALOGNUMBER" => CatalogNumber,
415423
"COMPILATION" => FlagCompilation,
416424
"MEDIA" => OriginalMediaType,
@@ -627,6 +635,18 @@ gen_item_keys!(
627635
// Identifiers
628636
Isrc,
629637
Barcode,
638+
/// [AcoustID] audio identifiers
639+
///
640+
/// Note that this may appear multiple times in a single tag.
641+
///
642+
/// [AcoustID]: https://acoustid.org/
643+
AcoustId,
644+
/// [AcoustID] audio fingerprints
645+
///
646+
/// Note that this may appear multiple times in a single tag.
647+
///
648+
/// [AcoustID]: https://acoustid.org/
649+
AcoustIdFingerprint,
630650
CatalogNumber,
631651
Work,
632652
Movement,

0 commit comments

Comments
 (0)