Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alternative (non-standard) ISRC mapping for ID3v2 #803

Merged
merged 2 commits into from
Apr 26, 2021
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
1 change: 1 addition & 0 deletions lib/id3v2/ID3v24TagMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const id3v24TagMap: INativeTagMap = {
TENC: 'encodedby',
TSSE: 'encodersettings',
'TXXX:BARCODE': 'barcode',
'TXXX:ISRC': 'isrc',
TSRC: 'isrc',
'TXXX:ASIN': 'asin',
'TXXX:originalyear': 'originalyear',
Expand Down
Binary file added test/samples/mp3/issue-802.mp3
Binary file not shown.
13 changes: 13 additions & 0 deletions test/test-id3v2.4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,17 @@ describe("Decode MP3/ID3v2.4", () => {

});

it("Map TXXX:ISRC", async () => {

const filename = 'issue-802.mp3';
const filePath = path.join(samplePath, 'mp3', filename);

const {common, native} = await mm.parseFile(filePath);
const id3v24 = native['ID3v2.4'];
t.isDefined(id3v24, 'ID3v2.4 presence');
t.strictEqual(id3v24.filter(tag => { return tag.id === 'TSRC'; }).length, 0, 'ID3v2.4 tag TSRC not defined');
t.strictEqual(id3v24.filter(tag => { return tag.id === 'TXXX:ISRC'; }).length, 1, 'ID3v2.4 tag TXXX:ISRC to be defined');
t.includeDeepMembers(common.isrc, ['DEAE61300058'], 'ISRC');
});

});