music-metadata
Advanced tools
Comparing version 0.9.4 to 0.9.5
@@ -9,2 +9,9 @@ /// <reference types="node" /> | ||
private static functionList(entries); | ||
/** | ||
* id3v2.4 defines that multiple T* values are separated by 0x00 | ||
* id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by / | ||
* @param {number} major Major version, e.g. (4) for id3v2.4 | ||
* @param {string} text Concatenated tag value | ||
* @returns {string[]} Slitted value | ||
*/ | ||
private static splitValue(major, text); | ||
@@ -11,0 +18,0 @@ private static trimArray(values); |
@@ -21,4 +21,2 @@ "use strict"; | ||
var text = Util_1.default.decodeString(b.slice(1), encoding).replace(/\x00+$/, ''); | ||
// id3v2.4 defines that multiple T* values are separated by 0x00 | ||
// id3v2.3 defines that multiple T* values are separated by / | ||
switch (type) { | ||
@@ -36,4 +34,12 @@ case 'TMCL': // Musician credits list | ||
break; | ||
case 'TCOM': | ||
case 'TEXT': | ||
case 'TOLY': | ||
case 'TOPE': | ||
case 'TPE1': | ||
// id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by / | ||
output = FrameParser.splitValue(major, text); | ||
break; | ||
default: | ||
output = FrameParser.splitValue(major, text); | ||
output = major >= 4 ? FrameParser.splitValue(major, text) : [text]; | ||
} | ||
@@ -134,2 +140,9 @@ break; | ||
}; | ||
/** | ||
* id3v2.4 defines that multiple T* values are separated by 0x00 | ||
* id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by / | ||
* @param {number} major Major version, e.g. (4) for id3v2.4 | ||
* @param {string} text Concatenated tag value | ||
* @returns {string[]} Slitted value | ||
*/ | ||
FrameParser.splitValue = function (major, text) { | ||
@@ -136,0 +149,0 @@ var values = text.split(major >= 4 ? /\x00/g : /\//g); |
{ | ||
"name": "music-metadata", | ||
"description": "Streaming music metadata parser for node and the browser.", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Borewit", |
273907
6746