diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared.module.ts | 3 | ||||
-rw-r--r-- | client/src/app/shared/video-playlist/video-playlist.service.ts | 14 |
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 | ||
10 | import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' | 10 | import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes' |
11 | import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' | 11 | import { SharedModule as PrimeSharedModule } from 'primeng/components/common/shared' |
12 | import { KeyFilterModule } from 'primeng/keyfilter' | ||
13 | 12 | ||
14 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' | 13 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' |
15 | import { ButtonComponent } from './buttons/button.component' | 14 | import { 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' | |||
17 | import { Account } from '@app/shared/account/account.model' | 17 | import { Account } from '@app/shared/account/account.model' |
18 | import { RestService } from '@app/shared/rest' | 18 | import { RestService } from '@app/shared/rest' |
19 | import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model' | 19 | import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model' |
20 | import { VideoPlaylistReorder } from '@shared/models/videos/playlist/video-playlist-reorder.model' | ||
20 | 21 | ||
21 | @Injectable() | 22 | @Injectable() |
22 | export class VideoPlaylistService { | 23 | export 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 | ||