From 075f4173760670a47af9dc3a6e2004d329b48947 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 7 Jan 2016 15:20:02 +0100 Subject: [PATCH] Issue 89: ignore repeated '.' or '-' in (buggy) track position http://www.discogs.com/release/1520366 has a track with buggy position, the script is placing the track at the wrong position because of this. 2-.23 Le Carnaval 0:26 2-.23 is now parsed as it was 2-23 This patch shouldn't affect non-buggy track positions. --- 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 e21d738..5d7f54d 100644 --- a/discogs_importer.user.js +++ b/discogs_importer.user.js @@ -657,7 +657,7 @@ function parseDiscogsRelease(data) { // A1 or A => Vinyl or Cassette : guess releaseNumber from vinyl side // 1-1 or 1.1 => releaseNumber.trackNumber // 1 => trackNumber - var tmp = trackPosition.match(/(\d+|[A-Z])(?:[\.-](\d+))?/i); + var tmp = trackPosition.match(/(\d+|[A-Z])(?:[\.-]+(\d+))?/i); if (tmp) { tmp[1] = parseInt(tmp[1], 10); var buggyTrackNumber = false;