Skip to content

Commit

Permalink
Actually parse uint8 atoms as uint8
Browse files Browse the repository at this point in the history
  • Loading branch information
leetreveil committed Mar 1, 2015
1 parent c89f0ba commit 4164900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/id4.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ function processMetaAtom (data, atomName, atomLength) {

case 'uint8':
if (atomName === 'gnre') {
var genreInt = strtok.UINT16_BE.get(data, 4);
var genreInt = strtok.UINT8.get(data, 5);
return common.GENRES[genreInt - 1];
}
if (atomName === 'trkn' || atomName === 'disk') {
return data[7] + '/' + data[9];
}

return strtok.UINT16_BE.get(data, 4);
return strtok.UINT8.get(data, 4);

case 'jpeg':
case 'png':
Expand Down
2 changes: 1 addition & 1 deletion test/test-id4.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('id4', function (t) {
t.strictEqual(result, 'Electronic', 'raw gnre');
})
.on('stik', function (result) {
t.strictEqual(result, 256, 'raw stik');
t.strictEqual(result, 1, 'raw stik');
})
.on('©alb', function (result) {
t.strictEqual(result, 'Voodoo People', 'raw ©alb');
Expand Down

0 comments on commit 4164900

Please sign in to comment.