aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-playlist
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-03-12 11:40:42 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit15e9d5ca39e0b792f61453fbf3885a0fc446afa7 (patch)
tree015628bc7497f45477d287e8bb482e39d5d491e2 /client/src/app/shared/video-playlist
parentc5a1ae500e68b759f76851552be6dd10631d34f4 (diff)
downloadPeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.tar.gz
PeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.tar.zst
PeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.zip
Playlist reorder support
Diffstat (limited to 'client/src/app/shared/video-playlist')
-rw-r--r--client/src/app/shared/video-playlist/video-playlist.service.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/video-playlist/video-playlist.service.ts
index f7b37f83a..da7437507 100644
--- a/client/src/app/shared/video-playlist/video-playlist.service.ts
+++ b/client/src/app/shared/video-playlist/video-playlist.service.ts
@@ -17,6 +17,7 @@ import { AccountService } from '@app/shared/account/account.service'
17import { Account } from '@app/shared/account/account.model' 17import { Account } from '@app/shared/account/account.model'
18import { RestService } from '@app/shared/rest' 18import { RestService } from '@app/shared/rest'
19import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model' 19import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model'
20import { VideoPlaylistReorder } from '@shared/models/videos/playlist/video-playlist-reorder.model'
20 21
21@Injectable() 22@Injectable()
22export class VideoPlaylistService { 23export class VideoPlaylistService {
@@ -125,6 +126,19 @@ export class VideoPlaylistService {
125 ) 126 )
126 } 127 }
127 128
129 reorderPlaylist (playlistId: number, oldPosition: number, newPosition: number) {
130 const body: VideoPlaylistReorder = {
131 startPosition: oldPosition,
132 insertAfterPosition: newPosition
133 }
134
135 return this.authHttp.post(VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL + playlistId + '/videos/reorder', body)
136 .pipe(
137 map(this.restExtractor.extractDataBool),
138 catchError(err => this.restExtractor.handleError(err))
139 )
140 }
141
128 doesVideoExistInPlaylist (videoId: number) { 142 doesVideoExistInPlaylist (videoId: number) {
129 this.videoExistsInPlaylistSubject.next(videoId) 143 this.videoExistsInPlaylistSubject.next(videoId)
130 144