1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Add ability to filter my videos by live

This commit is contained in:
Chocobozzz 2021-05-03 11:06:19 +02:00
parent dfcb6f50a6
commit 1fd61899ea
No known key found for this signature in database
GPG key ID: 583A612D890159BE
46 changed files with 569 additions and 336 deletions

View file

@ -1,9 +1,10 @@
import * as express from 'express'
import { getServerActor } from '@server/models/application/application'
import { VideosWithSearchCommonQuery } from '@shared/models'
import { buildNSFWFilter, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
import { getFormattedObjects } from '../../helpers/utils'
import { Hooks } from '../../lib/plugins/hooks'
import { JobQueue } from '../../lib/job-queue'
import { Hooks } from '../../lib/plugins/hooks'
import {
asyncMiddleware,
authenticate,
@ -158,25 +159,27 @@ async function listAccountVideos (req: express.Request, res: express.Response) {
const account = res.locals.account
const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
const countVideos = getCountVideos(req)
const query = req.query as VideosWithSearchCommonQuery
const apiOptions = await Hooks.wrapObject({
followerActorId,
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,
filter: req.query.filter,
nsfw: buildNSFWFilter(res, req.query.nsfw),
categoryOneOf: query.categoryOneOf,
licenceOneOf: query.licenceOneOf,
languageOneOf: query.languageOneOf,
tagsOneOf: query.tagsOneOf,
tagsAllOf: query.tagsAllOf,
filter: query.filter,
isLive: query.isLive,
nsfw: buildNSFWFilter(res, query.nsfw),
withFiles: false,
accountId: account.id,
user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
countVideos,
search: req.query.search
search: query.search
}, 'filter:api.accounts.videos.list.params')
const resultList = await Hooks.wrapPromiseFun(