From: Chocobozzz Date: Fri, 17 May 2019 12:52:44 +0000 (+0200) Subject: Fix reordering playlist X-Git-Tag: v1.3.0-rc.2~7 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b767c4a74aa5ce44c7b6a89962cb153ecb3ace07;p=oweals%2Fpeertube.git Fix reordering playlist --- diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts index 25d51d2cb..03f34412c 100644 --- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts +++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts @@ -67,7 +67,9 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro if (previousIndex === newIndex) return const oldPosition = this.videos[previousIndex].playlistElement.position - const insertAfter = newIndex === 0 ? 0 : this.videos[newIndex].playlistElement.position + let insertAfter = this.videos[newIndex].playlistElement.position + + if (oldPosition > insertAfter) insertAfter-- this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter) .subscribe(