diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-15 10:02:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | d23dd9fbfc4d26026352c10f81d2795ceaf2908a (patch) | |
tree | da82286d423c5e834a1ee2dcd5970076b8263cf1 /shared/extra-utils/videos/playlists-command.ts | |
parent | 7926c5f9b3ffcabb1ffb0dcfa5e48b8e0b88fbc0 (diff) | |
download | PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.gz PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.tar.zst PeerTube-d23dd9fbfc4d26026352c10f81d2795ceaf2908a.zip |
Introduce videos command
Diffstat (limited to 'shared/extra-utils/videos/playlists-command.ts')
-rw-r--r-- | shared/extra-utils/videos/playlists-command.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/shared/extra-utils/videos/playlists-command.ts b/shared/extra-utils/videos/playlists-command.ts index f77decc1a..75c8f2433 100644 --- a/shared/extra-utils/videos/playlists-command.ts +++ b/shared/extra-utils/videos/playlists-command.ts | |||
@@ -1,23 +1,22 @@ | |||
1 | import { omit, pick } from 'lodash' | 1 | import { omit, pick } from 'lodash' |
2 | import { HttpStatusCode } from '@shared/core-utils' | ||
2 | import { | 3 | import { |
3 | BooleanBothQuery, | 4 | BooleanBothQuery, |
4 | ResultList, | 5 | ResultList, |
5 | VideoExistInPlaylist, | 6 | VideoExistInPlaylist, |
6 | VideoPlaylist, | 7 | VideoPlaylist, |
8 | VideoPlaylistCreate, | ||
7 | VideoPlaylistCreateResult, | 9 | VideoPlaylistCreateResult, |
8 | VideoPlaylistElement, | 10 | VideoPlaylistElement, |
11 | VideoPlaylistElementCreate, | ||
9 | VideoPlaylistElementCreateResult, | 12 | VideoPlaylistElementCreateResult, |
10 | VideoPlaylistReorder | 13 | VideoPlaylistElementUpdate, |
14 | VideoPlaylistReorder, | ||
15 | VideoPlaylistType, | ||
16 | VideoPlaylistUpdate | ||
11 | } from '@shared/models' | 17 | } from '@shared/models' |
12 | import { HttpStatusCode } from '../../core-utils/miscs/http-error-codes' | ||
13 | import { VideoPlaylistCreate } from '../../models/videos/playlist/video-playlist-create.model' | ||
14 | import { VideoPlaylistElementCreate } from '../../models/videos/playlist/video-playlist-element-create.model' | ||
15 | import { VideoPlaylistElementUpdate } from '../../models/videos/playlist/video-playlist-element-update.model' | ||
16 | import { VideoPlaylistType } from '../../models/videos/playlist/video-playlist-type.model' | ||
17 | import { VideoPlaylistUpdate } from '../../models/videos/playlist/video-playlist-update.model' | ||
18 | import { unwrapBody } from '../requests' | 18 | import { unwrapBody } from '../requests' |
19 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 19 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
20 | import { videoUUIDToId } from './videos' | ||
21 | 20 | ||
22 | export class PlaylistsCommand extends AbstractCommand { | 21 | export class PlaylistsCommand extends AbstractCommand { |
23 | 22 | ||
@@ -185,7 +184,7 @@ export class PlaylistsCommand extends AbstractCommand { | |||
185 | const attributes = { | 184 | const attributes = { |
186 | ...options.attributes, | 185 | ...options.attributes, |
187 | 186 | ||
188 | videoId: await videoUUIDToId(this.server.url, options.attributes.videoId) | 187 | videoId: await this.server.videosCommand.getId({ ...options, uuid: options.attributes.videoId }) |
189 | } | 188 | } |
190 | 189 | ||
191 | const path = '/api/v1/video-playlists/' + options.playlistId + '/videos' | 190 | const path = '/api/v1/video-playlists/' + options.playlistId + '/videos' |