Fix user playlist reversal failing after user playlist information is updated (#4947)

This commit is contained in:
Jason 2024-04-16 15:46:43 +00:00 committed by GitHub
parent 9e151b74bb
commit 981e8e4530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 8 deletions

View File

@ -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
},