mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Add ability to search playlists
This commit is contained in:
parent
33eb19e519
commit
37a44fc915
79 changed files with 1652 additions and 549 deletions
|
@ -1,7 +1,9 @@
|
|||
import * as express from 'express'
|
||||
import { join } from 'path'
|
||||
import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists'
|
||||
import { getServerActor } from '@server/models/application/application'
|
||||
import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
import { VideoPlaylistCreate } from '../../../shared/models/videos/playlist/video-playlist-create.model'
|
||||
import { VideoPlaylistElementCreate } from '../../../shared/models/videos/playlist/video-playlist-element-create.model'
|
||||
import { VideoPlaylistElementUpdate } from '../../../shared/models/videos/playlist/video-playlist-element-update.model'
|
||||
|
@ -17,7 +19,6 @@ import { MIMETYPES, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers/constant
|
|||
import { sequelizeTypescript } from '../../initializers/database'
|
||||
import { sendCreateVideoPlaylist, sendDeleteVideoPlaylist, sendUpdateVideoPlaylist } from '../../lib/activitypub/send'
|
||||
import { getLocalVideoPlaylistActivityPubUrl, getLocalVideoPlaylistElementActivityPubUrl } from '../../lib/activitypub/url'
|
||||
import { JobQueue } from '../../lib/job-queue'
|
||||
import { updatePlaylistMiniatureFromExisting } from '../../lib/thumbnail'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
|
@ -42,7 +43,6 @@ import {
|
|||
import { AccountModel } from '../../models/account/account'
|
||||
import { VideoPlaylistModel } from '../../models/video/video-playlist'
|
||||
import { VideoPlaylistElementModel } from '../../models/video/video-playlist-element'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
const reqThumbnailFile = createReqFiles([ 'thumbnailfile' ], MIMETYPES.IMAGE.MIMETYPE_EXT, { thumbnailfile: CONFIG.STORAGE.TMP_DIR })
|
||||
|
||||
|
@ -144,9 +144,7 @@ async function listVideoPlaylists (req: express.Request, res: express.Response)
|
|||
function getVideoPlaylist (req: express.Request, res: express.Response) {
|
||||
const videoPlaylist = res.locals.videoPlaylistSummary
|
||||
|
||||
if (videoPlaylist.isOutdated()) {
|
||||
JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video-playlist', url: videoPlaylist.url } })
|
||||
}
|
||||
scheduleRefreshIfNeeded(videoPlaylist)
|
||||
|
||||
return res.json(videoPlaylist.toFormattedJSON())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue