From 28bc9c1d4f27f2bc088fddf5bb54d9c247dc51e6 Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 2 Mar 2020 14:51:52 -0500 Subject: [PATCH] fix: AlbumShow was adding previous played tracks when trying to shuffle the album --- ui/src/album/AlbumActions.js | 11 +++++++++-- ui/src/player/queue.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/src/album/AlbumActions.js b/ui/src/album/AlbumActions.js index eb16a51f1..2c7a48d1a 100644 --- a/ui/src/album/AlbumActions.js +++ b/ui/src/album/AlbumActions.js @@ -21,6 +21,13 @@ export const AlbumActions = ({ const dispatch = useDispatch() const translate = useTranslate() + // TODO Not sure why data is accumulating tracks from previous plays... Needs investigation. For now, filter out + // the unwanted tracks + const filteredData = ids.reduce((acc, id) => { + acc[id] = data[id] + return acc + }, {}) + const shuffle = (data) => { const ids = Object.keys(data) for (let i = ids.length - 1; i > 0; i--) { @@ -37,7 +44,7 @@ export const AlbumActions = ({