diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/video-playlist.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 5b1601c4e..feba30564 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -40,6 +40,7 @@ import { VideoPlaylistElementUpdate } from '../../../shared/models/videos/playli | |||
40 | import { copy, pathExists } from 'fs-extra' | 40 | import { copy, pathExists } from 'fs-extra' |
41 | import { AccountModel } from '../../models/account/account' | 41 | import { AccountModel } from '../../models/account/account' |
42 | import { VideoPlaylistReorder } from '../../../shared/models/videos/playlist/video-playlist-reorder.model' | 42 | import { VideoPlaylistReorder } from '../../../shared/models/videos/playlist/video-playlist-reorder.model' |
43 | import { JobQueue } from '../../lib/job-queue' | ||
43 | 44 | ||
44 | const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR }) | 45 | const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR }) |
45 | 46 | ||
@@ -142,6 +143,11 @@ async function listVideoPlaylists (req: express.Request, res: express.Response) | |||
142 | function getVideoPlaylist (req: express.Request, res: express.Response) { | 143 | function getVideoPlaylist (req: express.Request, res: express.Response) { |
143 | const videoPlaylist = res.locals.videoPlaylist | 144 | const videoPlaylist = res.locals.videoPlaylist |
144 | 145 | ||
146 | if (videoPlaylist.isOutdated()) { | ||
147 | JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video-playlist', url: videoPlaylist.url } }) | ||
148 | .catch(err => logger.error('Cannot create AP refresher job for playlist %s.', videoPlaylist.url, { err })) | ||
149 | } | ||
150 | |||
145 | return res.json(videoPlaylist.toFormattedJSON()) | 151 | return res.json(videoPlaylist.toFormattedJSON()) |
146 | } | 152 | } |
147 | 153 | ||