aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
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
parentc5a1ae500e68b759f76851552be6dd10631d34f4 (diff)
downloadPeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.tar.gz
PeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.tar.zst
PeerTube-15e9d5ca39e0b792f61453fbf3885a0fc446afa7.zip
Playlist reorder support
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/shared.module.ts3
-rw-r--r--client/src/app/shared/video-playlist/video-playlist.service.ts14
2 files changed, 14 insertions, 3 deletions
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts
index 1f9eee0b7..05da0d829 100644
--- a/client/src/app/shared/shared.module.ts
+++ b/client/src/app/shared/shared.module.ts
@@ -9,7 +9,6 @@ import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.d
9 9
10import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' 10import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes'
11import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' 11import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared'
12import { KeyFilterModule } from 'primeng/keyfilter'
13 12
14import { AUTH_INTERCEPTOR_PROVIDER } from './auth' 13import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
15import { ButtonComponent } from './buttons/button.component' 14import { ButtonComponent } from './buttons/button.component'
@@ -95,7 +94,6 @@ import { TimestampInputComponent } from '@app/shared/forms/timestamp-input.compo
95 94
96 PrimeSharedModule, 95 PrimeSharedModule,
97 InputMaskModule, 96 InputMaskModule,
98 KeyFilterModule,
99 NgPipesModule 97 NgPipesModule
100 ], 98 ],
101 99
@@ -155,7 +153,6 @@ import { TimestampInputComponent } from '@app/shared/forms/timestamp-input.compo
155 153
156 PrimeSharedModule, 154 PrimeSharedModule,
157 InputMaskModule, 155 InputMaskModule,
158 KeyFilterModule,
159 BytesPipe, 156 BytesPipe,
160 KeysPipe, 157 KeysPipe,
161 158
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