From e2e0b645cdac3c705b1988fbb0eff723ad5e885d Mon Sep 17 00:00:00 2001 From: kontrollanten <6680299+kontrollanten@users.noreply.github.com> Date: Mon, 28 Jun 2021 09:22:15 +0200 Subject: 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 --- server/controllers/api/video-playlist.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/controllers') 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 { import { AccountModel } from '../../models/account/account' import { VideoPlaylistModel } from '../../models/video/video-playlist' import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element' +import { Hooks } from '@server/lib/plugins/hooks' const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR }) @@ -330,6 +331,8 @@ async function addVideoInPlaylist (req: express.Request, res: express.Response) logger.info('Video added in playlist %s at position %d.', videoPlaylist.uuid, playlistElement.position) + Hooks.runAction('action:api.video-playlist-element.created', { playlistElement }) + return res.json({ videoPlaylistElement: { id: playlistElement.id -- cgit v1.2.3