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.
This commit is contained in:
Laurent Monin 2016-01-07 15:20:02 +01:00
parent 6a8d60d4a1
commit 075f417376

View file

@ -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;