aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/accounts.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/accounts.ts')
-rw-r--r--server/controllers/api/accounts.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/api/accounts.ts b/server/controllers/api/accounts.ts
index e24545de8..adbf69781 100644
--- a/server/controllers/api/accounts.ts
+++ b/server/controllers/api/accounts.ts
@@ -17,7 +17,6 @@ import { VideoChannelModel } from '../../models/video/video-channel'
17import { JobQueue } from '../../lib/job-queue' 17import { JobQueue } from '../../lib/job-queue'
18import { logger } from '../../helpers/logger' 18import { logger } from '../../helpers/logger'
19import { VideoPlaylistModel } from '../../models/video/video-playlist' 19import { VideoPlaylistModel } from '../../models/video/video-playlist'
20import { UserModel } from '../../models/account/user'
21import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists' 20import { commonVideoPlaylistFiltersValidator } from '../../middlewares/validators/videos/video-playlists'
22 21
23const accountsRouter = express.Router() 22const accountsRouter = express.Router()
@@ -71,7 +70,7 @@ export {
71// --------------------------------------------------------------------------- 70// ---------------------------------------------------------------------------
72 71
73function getAccount (req: express.Request, res: express.Response) { 72function getAccount (req: express.Request, res: express.Response) {
74 const account: AccountModel = res.locals.account 73 const account = res.locals.account
75 74
76 if (account.isOutdated()) { 75 if (account.isOutdated()) {
77 JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'actor', url: account.Actor.url } }) 76 JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'actor', url: account.Actor.url } })
@@ -98,7 +97,7 @@ async function listAccountPlaylists (req: express.Request, res: express.Response
98 97
99 // Allow users to see their private/unlisted video playlists 98 // Allow users to see their private/unlisted video playlists
100 let privateAndUnlisted = false 99 let privateAndUnlisted = false
101 if (res.locals.oauth && (res.locals.oauth.token.User as UserModel).Account.id === res.locals.account.id) { 100 if (res.locals.oauth && res.locals.oauth.token.User.Account.id === res.locals.account.id) {
102 privateAndUnlisted = true 101 privateAndUnlisted = true
103 } 102 }
104 103
@@ -116,7 +115,7 @@ async function listAccountPlaylists (req: express.Request, res: express.Response
116} 115}
117 116
118async function listAccountVideos (req: express.Request, res: express.Response) { 117async function listAccountVideos (req: express.Request, res: express.Response) {
119 const account: AccountModel = res.locals.account 118 const account = res.locals.account
120 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined 119 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
121 120
122 const resultList = await VideoModel.listForApi({ 121 const resultList = await VideoModel.listForApi({