diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2021-06-28 09:22:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 09:22:15 +0200 |
commit | e2e0b645cdac3c705b1988fbb0eff723ad5e885d (patch) | |
tree | 0e8d7d5d7bfbd5815f89e1444b693d5a7662a6a7 /server/controllers | |
parent | 3e84ae325088320c49dd07de2d3a0d020151002e (diff) | |
download | PeerTube-e2e0b645cdac3c705b1988fbb0eff723ad5e885d.tar.gz PeerTube-e2e0b645cdac3c705b1988fbb0eff723ad5e885d.tar.zst PeerTube-e2e0b645cdac3c705b1988fbb0eff723ad5e885d.zip |
Add video-playlist-element.created hook (#4196)
* add playlists.videos.list.params/results hooks
closes #4192
* Revert "add playlists.videos.list.params/results hooks"
This reverts commit ebd822ca0b769d88dbc5ae0062b286238cbced92.
* add video-playlist-element.created hook
closes #4192
* test: add playlist-element.created
* Fix tests
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/video-playlist.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index c25aed20b..5c4aa50ac 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -43,6 +43,7 @@ import { | |||
43 | import { AccountModel } from '../../models/account/account' | 43 | import { AccountModel } from '../../models/account/account' |
44 | import { VideoPlaylistModel } from '../../models/video/video-playlist' | 44 | import { VideoPlaylistModel } from '../../models/video/video-playlist' |
45 | import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element' | 45 | import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element' |
46 | import { Hooks } from '@server/lib/plugins/hooks' | ||
46 | 47 | ||
47 | const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR }) | 48 | const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR }) |
48 | 49 | ||
@@ -330,6 +331,8 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) | |||
330 | 331 | ||
331 | logger.info('Video added in playlist %s at position %d.', videoPlaylist.uuid, playlistElement.position) | 332 | logger.info('Video added in playlist %s at position %d.', videoPlaylist.uuid, playlistElement.position) |
332 | 333 | ||
334 | Hooks.runAction('action:api.video-playlist-element.created', { playlistElement }) | ||
335 | |||
333 | return res.json({ | 336 | return res.json({ |
334 | videoPlaylistElement: { | 337 | videoPlaylistElement: { |
335 | id: playlistElement.id | 338 | id: playlistElement.id |