discogs: ignore medium formats that are not mapped to MB formats.

This should prevent trying to map e.g. "Box-set".
This commit is contained in:
Aurélien Mino 2015-06-17 23:50:22 +02:00
parent 304affacc7
commit 9b8a8ef5c4

View file

@ -499,8 +499,11 @@ function parseDiscogsRelease(data) {
if (discogsRelease.formats.length > 0) {
for(var i = 0; i < discogsRelease.formats.length; i++)
{
for(var j = 0; j < discogsRelease.formats[i].qty; j++)
release_formats.push(MediaTypes[ discogsRelease.formats[i].name ]);
for(var j = 0; j < discogsRelease.formats[i].qty; j++) {
if (discogsRelease.formats[i].name in MediaTypes) {
release_formats.push(MediaTypes[discogsRelease.formats[i].name]);
}
}
if (discogsRelease.formats[i].descriptions) {
$.each(discogsRelease.formats[i].descriptions, function(index, desc) {