import { JobQueue } from '../../lib/job-queue'
import { logger } from '../../helpers/logger'
import { VideoPlaylistModel } from '../../models/video/video-playlist'
-import { UserModel } from '../../models/account/user'
import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
const accountsRouter = express.Router()
// ---------------------------------------------------------------------------
function getAccount (req: express.Request, res: express.Response) {
- const account: AccountModel = res.locals.account
+ const account = res.locals.account
if (account.isOutdated()) {
JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'actor', url: account.Actor.url } })
// Allow users to see their private/unlisted video playlists
let privateAndUnlisted = false
- if (res.locals.oauth && (res.locals.oauth.token.User as UserModel).Account.id === res.locals.account.id) {
+ if (res.locals.oauth && res.locals.oauth.token.User.Account.id === res.locals.account.id) {
privateAndUnlisted = true
}
}
async function listAccountVideos (req: express.Request, res: express.Response) {
- const account: AccountModel = res.locals.account
+ const account = res.locals.account
const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
const resultList = await VideoModel.listForApi({