diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 14:13:53 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 14:13:53 +0100 |
commit | 9f79ade627f0044606a9fbbe16ca0154661d12b9 (patch) | |
tree | ccfc1876da591bc52cbb4b8ccddedbeae7876679 /server/controllers | |
parent | 0e0c745b62b2f18e228328e8c4f95b17e54f7a5e (diff) | |
download | PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.gz PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.tar.zst PeerTube-9f79ade627f0044606a9fbbe16ca0154661d12b9.zip |
Refresh playlists
Diffstat (limited to 'server/controllers')
-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 | ||