diff --git a/js/actionCreators.js b/js/actionCreators.js index e9699374..be6a0c85 100644 --- a/js/actionCreators.js +++ b/js/actionCreators.js @@ -171,10 +171,10 @@ function setEqFromFile(file) { }; } -function addTracksFromReferences(fileReferences, atIndex) { +function addTracksFromReferences(fileReferences, autoPlay, atIndex) { return dispatch => { Array.from(fileReferences).forEach((file, i) => { - const priority = i === 0 ? "PLAY" : "NONE"; + const priority = i === 0 && autoPlay ? "PLAY" : "NONE"; const id = uniqueId(); const url = URL.createObjectURL(file); dispatch(_addTrackFromUrl(url, file.name, id, priority, atIndex + i)); @@ -185,7 +185,11 @@ function addTracksFromReferences(fileReferences, atIndex) { const SKIN_FILENAME_MATCHER = new RegExp("(wsz|zip)$", "i"); const EQF_FILENAME_MATCHER = new RegExp("eqf$", "i"); -export function loadFilesFromReferences(fileReferences, atIndex = null) { +export function loadFilesFromReferences( + fileReferences, + autoPlay = true, + atIndex = null +) { return dispatch => { if (fileReferences.length < 1) { return; @@ -201,7 +205,7 @@ export function loadFilesFromReferences(fileReferences, atIndex = null) { return; } } - dispatch(addTracksFromReferences(fileReferences, atIndex)); + dispatch(addTracksFromReferences(fileReferences, autoPlay, atIndex)); }; } diff --git a/js/components/PlaylistWindow/index.js b/js/components/PlaylistWindow/index.js index 0725c28b..6ae56e37 100644 --- a/js/components/PlaylistWindow/index.js +++ b/js/components/PlaylistWindow/index.js @@ -175,7 +175,7 @@ const mapDispatchToProps = (dispatch, ownProps) => ({ scrollUpFourTracks: () => dispatch(scrollUpFourTracks()), scrollDownFourTracks: () => dispatch(scrollDownFourTracks()), loadFilesFromReferences: (e, startIndex) => - dispatch(loadFilesFromReferences(e.dataTransfer.files, startIndex)) + dispatch(loadFilesFromReferences(e.dataTransfer.files, false, startIndex)) }); const mapStateToProps = state => {