discogs: minor simplification, use one replace() instead of 2

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

View file

@ -557,7 +557,7 @@ function parseDiscogsRelease(data) {
// Release packaging
if (discogsRelease.formats[i].text) {
var freetext = discogsRelease.formats[i].text.toLowerCase().replace(/-/g, '').replace(/ /g, '');
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";