Fix reordering playlist

pull/1935/head
Chocobozzz 2019-05-17 14:52:44 +02:00
parent 1c8ddbfaa0
commit b767c4a74a
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
if (previousIndex === newIndex) return if (previousIndex === newIndex) return
const oldPosition = this.videos[previousIndex].playlistElement.position 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) this.videoPlaylistService.reorderPlaylist(this.playlist.id, oldPosition, insertAfter)
.subscribe( .subscribe(