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

POPM and SYLT #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
29 changes: 27 additions & 2 deletions dist/musicmetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,14 @@ exports.readData = function readData (b, type, flags, major) {

case 'ULT':
case 'USLT':
var lyrc = []
lyrc[0] = decodeString(b, 'utf16')
lyrc[1] = decodeString(b, 'utf8')
//iso-8859-1 | utf16 (utf16le) | utf8

output = [lyrc]
break

case 'COM':
case 'COMM':
var out = {}
Expand All @@ -1217,6 +1225,17 @@ exports.readData = function readData (b, type, flags, major) {
output = [out]
break

case 'POPM':
var rating = {}

fzero = findZero(b, offset, length, encoding)
rating.owner_identifier = decodeString(b.slice(offset, fzero), encoding)
offset = fzero + nullTerminatorLength

rating.rating = b.slice(offset, length)[0]
output = [rating]
break

case 'UFID':
var ufid = {}

Expand Down Expand Up @@ -1449,6 +1468,10 @@ module.exports = function (stream, opts, callback) {
genre: [],
disk: { no: 0, of: 0 },
picture: [],
comment: [],
ratings: [],
lyrics: [],
ulyrics: [],
duration: 0
}

Expand Down Expand Up @@ -1583,7 +1606,9 @@ function lookupAlias (event) {
'Cover Art (Back)'],
['composer', 'TCOM', 'TCM', '©wrt', 'COMPOSER'],
['duration'],
['lyrics', 'SYLT']
['ratings', 'POPM'],
['lyrics', 'SYLT'],
['ulyrics', 'USLT']
]

return mappings.reduce(function (a, b) {
Expand Down Expand Up @@ -8892,4 +8917,4 @@ function hasOwnProperty(obj, prop) {

}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./support/isBuffer":51,"_process":31,"inherits":50}]},{},[2])(2)
});
});