discogs: since we want only one packaging, skip other matches using else if

This commit is contained in:
Laurent Monin 2015-06-23 10:19:54 +02:00
parent 8171491d14
commit 4790f70a0d

View file

@ -559,9 +559,9 @@ function parseDiscogsRelease(data) {
if (discogsRelease.formats[i].text) {
var freetext = discogsRelease.formats[i].text.toLowerCase().replace(/[\s-]/g, '');
if (freetext.match(/cardboard|paper/)) release.packaging = "cardboard/paper sleeve";
if (freetext.match(/digipak/)) release.packaging = "digipak";
if (freetext.match(/keepcase/)) release.packaging = "keep case";
if (freetext.match(/jewel/)) {
else if (freetext.match(/digipak/)) release.packaging = "digipak";
else if (freetext.match(/keepcase/)) release.packaging = "keep case";
else if (freetext.match(/jewel/)) {
release.packaging = freetext.match(/slim/) ? "slim jewel case" : "jewel case";
}
}