Skip to content

Commit

Permalink
Bump version number to 0.7.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Aug 19, 2017
1 parent 9b99259 commit e661847
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "music-metadata",
"description": "Streaming music metadata parser for node and the browser.",
"version": "0.7.14",
"version": "0.7.15",
"author": {
"name": "Borewit",
"url": "https://github.com/Borewit"
Expand Down
28 changes: 15 additions & 13 deletions src/id3v1/ID3v1Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ interface Iid3v1Header {
}

/**
* Ref: https://en.wikipedia.org/wiki/ID3
* Spec: http://id3.org/ID3v1
* Wiki: https://en.wikipedia.org/wiki/ID3
*/
const Iid3v1Token: Token.IGetToken<Iid3v1Header> = {
len: 128,
Expand All @@ -77,9 +78,11 @@ const Iid3v1Token: Token.IGetToken<Iid3v1Header> = {
album: new Id3v1StringType(30, 'ascii').get(buf, off + 63),
year: new Id3v1StringType(4, 'ascii').get(buf, off + 93),
comment: new Id3v1StringType(28, 'ascii').get(buf, off + 97),
zeroByte: Token.INT8.get(buf, off + 127),
track: Token.INT8.get(buf, off + 126),
genre: Token.INT8.get(buf, off + 127)
// ID3v1.1 separator for track
zeroByte: Token.UINT8.get(buf, off + 127),
// track: ID3v1.1 field added by Michael Mutschler
track: Token.UINT8.get(buf, off + 126),
genre: Token.UINT8.get(buf, off + 127)
} : null;
}
};
Expand Down Expand Up @@ -119,15 +122,14 @@ export class ID3v1Parser implements ITokenParser {
};
if (header) {
res.format.headerType = 'id3v1.1' as HeaderType;
res.native['id3v1.1'] = [
{id: 'title', value: header.title},
{id: 'artist', value: header.artist},
{id: 'album', value: header.album},
{id: 'comment', value: header.comment},
{id: 'track', value: header.track},
{id: 'year', value: header.year},
{id: 'genre', value: ID3v1Parser.getGenre(header.genre)}
];
const id3 = res.native['id3v1.1'] = [];
for (const id of ['title', 'artist', 'album', 'comment', 'track', 'year']) {
if (header[id] && header[id] !== '')
id3.push({id, value: header[id]});
}
const genre = ID3v1Parser.getGenre(header.genre);
if (genre)
id3.push({id: 'genre', value: genre});
}
return res;
});
Expand Down

0 comments on commit e661847

Please sign in to comment.