From 8171491d14fb2787929d4db5e94a06cf71b775e5 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Tue, 23 Jun 2015 10:19:16 +0200 Subject: [PATCH] discogs: minor simplification, use one replace() instead of 2 --- discogs_importer.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discogs_importer.user.js b/discogs_importer.user.js index d11d61f..2639d82 100644 --- a/discogs_importer.user.js +++ b/discogs_importer.user.js @@ -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";