From 232273c4dc4337bbab0dd24438788be867b81562 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 25 Aug 2019 02:24:08 -0400 Subject: [PATCH] Fixed: Manual Import Tracks Sorted Wrong Fixes #848 --- .../InteractiveImport/Interactive/InteractiveImportRow.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js index 5f966b908..06c2aed2a 100644 --- a/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js +++ b/frontend/src/InteractiveImport/Interactive/InteractiveImportRow.js @@ -176,7 +176,10 @@ class InteractiveImportRow extends Component { if (album) { albumTitle = album.disambiguation ? `${album.title} (${album.disambiguation})` : album.title; } - const trackNumbers = tracks.map((track) => `${track.mediumNumber}x${track.trackNumber}`) + + const sortedTracks = tracks.sort((a, b) => parseInt(a.absoluteTrackNumber) - parseInt(b.absoluteTrackNumber)); + + const trackNumbers = sortedTracks.map((track) => `${track.mediumNumber}x${track.trackNumber}`) .join(', '); const showArtistPlaceholder = isSelected && !artist;