From a5138fe3d7013393c5c3f4aaea8510caaf60e40a Mon Sep 17 00:00:00 2001 From: "Pascal \"Pixel\" Rigaux" Date: Fri, 16 Jan 2015 13:56:36 +0100 Subject: [PATCH] fix #31: handle discogs tracks in case of sub-tracks in case of sub-tracks (at least for http://api.discogs.com/releases/5880212 ), json field "position" is "" so previous code ignored the track. The solution here is to use first sub-track position which is good enough to detect change of CD numbers. --- discogs_importer.user.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discogs_importer.user.js b/discogs_importer.user.js index 4b6f6f5..e3575ff 100644 --- a/discogs_importer.user.js +++ b/discogs_importer.user.js @@ -371,6 +371,10 @@ function parseDiscogsRelease(data) { // Track position and release number var trackPosition = discogsTrack.position; + if (trackPosition == "" && discogsTrack.sub_tracks) { + trackPosition = discogsTrack.sub_tracks[0].position; + } + // Skip special tracks if (trackPosition.toLowerCase().match("^(video|mp3)")) { trackPosition = "";