import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths'
import { getServerActor } from '@server/models/application/application'
import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
-import { VideoCreate, VideoState, VideoUpdate } from '../../../../shared'
+import { VideoCreate, VideosCommonQuery, VideoState, VideoUpdate } from '../../../../shared'
import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
-import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger'
import { resetSequelizeInstance, retryTransactionWrapper } from '../../../helpers/database-utils'
import { buildNSFWFilter, createReqFiles, getCountVideos } from '../../../helpers/express-utils'
}, { transaction: t })
}
+ // Channel has a new content, set as updated
+ await videoCreated.VideoChannel.setAsUpdated(t)
+
await autoBlacklistVideoIfNeeded({
video,
user: res.locals.oauth.token.User,
}
async function listVideos (req: express.Request, res: express.Response) {
+ const query = req.query as VideosCommonQuery
const countVideos = getCountVideos(req)
const apiOptions = await Hooks.wrapObject({
- start: req.query.start,
- count: req.query.count,
- sort: req.query.sort,
+ start: query.start,
+ count: query.count,
+ sort: query.sort,
includeLocalVideos: true,
- categoryOneOf: req.query.categoryOneOf,
- licenceOneOf: req.query.licenceOneOf,
- languageOneOf: req.query.languageOneOf,
- tagsOneOf: req.query.tagsOneOf,
- tagsAllOf: req.query.tagsAllOf,
- nsfw: buildNSFWFilter(res, req.query.nsfw),
- filter: req.query.filter as VideoFilter,
+ categoryOneOf: query.categoryOneOf,
+ licenceOneOf: query.licenceOneOf,
+ languageOneOf: query.languageOneOf,
+ tagsOneOf: query.tagsOneOf,
+ tagsAllOf: query.tagsAllOf,
+ nsfw: buildNSFWFilter(res, query.nsfw),
+ isLive: query.isLive,
+ filter: query.filter,
withFiles: false,
user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
countVideos