From 981e8e4530c5b0214481410ed8146ab661fa9fc5 Mon Sep 17 00:00:00 2001 From: Jason <84899178+jasonhenriquez@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:46:43 +0000 Subject: [PATCH] Fix user playlist reversal failing after user playlist information is updated (#4947) --- .../watch-video-playlist/watch-video-playlist.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/watch-video-playlist/watch-video-playlist.js b/src/renderer/components/watch-video-playlist/watch-video-playlist.js index 2689326bf..97a30b257 100644 --- a/src/renderer/components/watch-video-playlist/watch-video-playlist.js +++ b/src/renderer/components/watch-video-playlist/watch-video-playlist.js @@ -166,13 +166,6 @@ export default defineComponent({ // Re-fetch from local store when current user playlist updated this.parseUserPlaylist(this.selectedUserPlaylist, { allowPlayingVideoRemoval: true }) }, - playlistItemId (newId, _oldId) { - // Playing online video - if (newId == null) { return } - - // Re-fetch from local store when different item played - this.parseUserPlaylist(this.selectedUserPlaylist, { allowPlayingVideoRemoval: true }) - }, videoId: function (newId, oldId) { // Check if next video is from the shuffled list or if the user clicked a different video if (this.shuffleEnabled) { @@ -284,7 +277,7 @@ export default defineComponent({ this.reversePlaylist = !this.reversePlaylist // Create a new array to avoid changing array in data store state // it could be user playlist or cache playlist - this.playlistItems = [].concat(this.playlistItems).reverse() + this.playlistItems = this.playlistItems.toReversed() setTimeout(() => { this.isLoading = false }, 1) @@ -488,6 +481,10 @@ export default defineComponent({ } } + if (this.reversePlaylist) { + this.playlistItems = this.playlistItems.toReversed() + } + this.isLoading = false },