"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-use-before-define": "off",
+
+ "require-await": "off",
+ "@typescript-eslint/require-await": "error",
+
// bugged but useful
"@typescript-eslint/restrict-plus-operands": "off"
},
this.loadCategoriesAndLanguages()
}
- async formValidated () {
+ formValidated () {
const value: ComponentCustomConfig = this.form.getRawValue()
forkJoin([
return window.location.protocol === 'https:'
}
- private async addFollowing () {
+ private addFollowing () {
const hostsOrHandles = splitAndGetNotEmpty(this.form.value['hostsOrHandles'])
this.followService.follow(hostsOrHandles)
})
}
- private async removeComments (comments: VideoCommentAdmin[]) {
+ private removeComments (comments: VideoCommentAdmin[]) {
const commentArgs = comments.map(c => ({ videoId: c.video.id, commentId: c.id }))
this.videoCommentService.deleteVideoComments(commentArgs)
})
}
- async setEmailsAsVerified (users: User[]) {
+ setEmailsAsVerified (users: User[]) {
this.userService.updateUsers(users, { emailVerified: true })
.subscribe({
next: () => {
private customPageService: CustomPageService
) { }
- async ngOnInit () {
+ ngOnInit () {
this.customPageService.getInstanceHomepage()
.subscribe(({ content }) => this.homepageContent = content)
}
this.subActivatedRoute = this.route.queryParams
.subscribe({
- next: async queryParams => {
+ next: queryParams => {
const querySearch = queryParams['search']
const searchTarget = queryParams['searchTarget']
return languageId && this.existingCaptions.includes(languageId)
}
- async addCaption () {
+ addCaption () {
const languageId = this.form.value['language']
const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
this.sortVideoCaptions()
}
- async deleteCaption (caption: VideoCaptionEdit) {
+ deleteCaption (caption: VideoCaptionEdit) {
// Caption recovers his former state
if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) {
caption.action = undefined
private serverService: ServerService
) { }
- async ngOnInit () {
+ ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
+
if (
isWebRTCDisabled() ||
this.serverConfig.tracker.enabled === false ||
return this.userService.getAnonymousUser()
}
- async ngOnInit () {
+ ngOnInit () {
this.serverConfig = this.serverService.getHTMLConfig()
PeertubePlayerManager.initState()
}
if (oldVideo && oldVideo.id !== newVideo.id) {
- await this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id)
+ this.peertubeSocket.unsubscribeLiveVideos(oldVideo.id)
}
if (!newVideo.isLive) return
}
}
- private async openModalsIfNeeded () {
+ private openModalsIfNeeded () {
this.authService.userInformationLoaded
.pipe(
map(() => this.authService.getUser()),
).subscribe(({ serverConfig, user }) => this._openAdminModalsIfNeeded(serverConfig, user))
}
- private async _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) {
+ private _openAdminModalsIfNeeded (serverConfig: ServerConfig, user: User) {
if (user.noWelcomeModal !== true) return this.welcomeModal.show()
if (user.noInstanceConfigWarningModal === true || !serverConfig.signup.allowed) return
this.liveVideosSocket.emit('subscribe', { videoId })
}
- async unsubscribeLiveVideos (videoId: number) {
+ unsubscribeLiveVideos (videoId: number) {
if (!this.liveVideosSocket) return
this.liveVideosSocket.emit('unsubscribe', { videoId })
this.form.reset()
}
- async banUser () {
+ banUser () {
const moderationComment: string = this.form.value['moderationComment']
this.abuseService.updateAbuse(this.abuseToComment, { moderationComment })
this.modalService.open(this.modal, {
centered: true,
- beforeDismiss: async () => {
+ beforeDismiss: () => {
this.onModalDismiss()
+
return true
}
})
this.openedModal.close()
}
- async banUser () {
+ banUser () {
const reason = this.form.value['reason'] || undefined
this.userService.banUsers(this.usersToBan, reason)
this.updateInterval = setInterval(async () => {
try {
const options = this.mode === 'p2p-media-loader'
- ? await this.buildHLSOptions()
+ ? this.buildHLSOptions()
: await this.buildWebTorrentOptions() // Default
this.list.innerHTML = this.getListTemplate(options)
this.container.style.display = 'none'
}
- private async buildHLSOptions () {
+ private buildHLSOptions () {
const p2pMediaLoader = this.player_.p2pMediaLoader()
const level = p2pMediaLoader.getCurrentLevel()
private runCleaner () {
this.checkExpiration()
- this.cleanerInterval = setInterval(async () => {
+ this.cleanerInterval = setInterval(() => {
this.checkExpiration()
}, PeertubeChunkStore.CLEANER_INTERVAL_MS)
}
this.buildCSS()
- await this.buildDock(videoInfo)
+ this.buildDock(videoInfo)
this.initializeApi()
}
}
- private async buildDock (videoInfo: VideoDetails) {
+ private buildDock (videoInfo: VideoDetails) {
if (!this.controls) return
// On webtorrent fallback, player may have been disposed
let playbackRates: number[] = []
let currentRate = await player.getPlaybackRate()
- const updateRates = async () => {
+ const updateRates = () => {
const rateListEl = document.querySelector('#rate-list')
rateListEl.innerHTML = ''
videoChannelRouter.get('/:nameWithHost',
asyncMiddleware(videoChannelsNameWithHostValidator),
- asyncMiddleware(getVideoChannel)
+ getVideoChannel
)
videoChannelRouter.get('/:nameWithHost/video-playlists',
return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end()
}
-async function getVideoChannel (req: express.Request, res: express.Response) {
+function getVideoChannel (req: express.Request, res: express.Response) {
const videoChannel = res.locals.videoChannel
if (videoChannel.isOutdated()) {
optionalAuthenticate,
asyncMiddleware(videosCustomGetValidator('for-api')),
asyncMiddleware(checkVideoFollowConstraints),
- asyncMiddleware(getVideo)
+ getVideo
)
videosRouter.post('/:id/views',
openapiOperationDoc({ operationId: 'addView' }),
res.json(VIDEO_PRIVACIES)
}
-async function getVideo (_req: express.Request, res: express.Response) {
+function getVideo (_req: express.Request, res: express.Response) {
const video = res.locals.videoAPI
if (video.isOutdated()) {
liveRouter.get('/live/:videoId',
authenticate,
asyncMiddleware(videoLiveGetValidator),
- asyncRetryTransactionMiddleware(getLiveVideo)
+ getLiveVideo
)
liveRouter.put('/live/:videoId',
// ---------------------------------------------------------------------------
-async function getLiveVideo (req: express.Request, res: express.Response) {
+function getLiveVideo (req: express.Request, res: express.Response) {
const videoLive = res.locals.videoLive
return res.json(videoLive.toFormattedJSON())
return command
}
-async function buildHLSVODFromTSCommand (command: ffmpeg.FfmpegCommand, options: HLSFromTSTranscodeOptions) {
+function buildHLSVODFromTSCommand (command: ffmpeg.FfmpegCommand, options: HLSFromTSTranscodeOptions) {
const videoPath = getHLSVideoPath(options)
command.outputOption('-c copy')
})
}
-async function handleOAuthAuthenticate (
+function handleOAuthAuthenticate (
req: express.Request,
res: express.Response,
authenticateInQuery = false
private watchMasterFile (outPath: string) {
this.masterWatcher = chokidar.watch(outPath + '/' + this.streamingPlaylist.playlistFilename)
- this.masterWatcher.on('add', async () => {
+ this.masterWatcher.on('add', () => {
this.emit('master-playlist-created', { videoId: this.videoId })
this.masterWatcher.close()
}) {
const { baseAbuse, accountInstance, transaction, reporterAccount } = options
- const associateFun = async () => {
- return { isOwned: accountInstance.isOwned() }
+ const associateFun = () => {
+ return Promise.resolve({ isOwned: accountInstance.isOwned() })
}
return createAbuse({
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
const instanceUrl = this.actorFollow.ActorFollowing.url
return {
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
const awaitingApproval = this.actorFollow.state === 'pending'
? ' awaiting manual approval.'
: ''
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
const following = this.actorFollow.ActorFollowing
const follower = this.actorFollow.ActorFollower
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
return {
to,
template: 'peertube-version-new',
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
const pluginUrl = WEBSERVER.URL + '/admin/plugins/list-installed?pluginType=' + this.plugin.type
return {
return notification
}
- async createEmail (to: string) {
+ createEmail (to: string) {
return {
template: 'user-registered',
to,
* * https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
*/
-const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = async (options: EncoderOptionsBuilderParams) => {
+const defaultX264VODOptionsBuilder: EncoderOptionsBuilder = (options: EncoderOptionsBuilderParams) => {
const { fps, inputRatio, inputBitrate } = options
if (!fps) return { outputOptions: [ ] }
}
}
-const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = async (options: EncoderOptionsBuilderParams) => {
+const defaultX264LiveOptionsBuilder: EncoderOptionsBuilder = (options: EncoderOptionsBuilderParams) => {
const { streamNum, fps, inputBitrate, inputRatio } = options
const targetBitrate = capBitrate(inputBitrate, getAverageBitrate({ ...options, fps, ratio: inputRatio }))
return new Promise<any>((res, rej) => {
const options = [ '-j', '--flat-playlist', '--playlist-reverse', ...args ]
- youtubeDL.getInfo(url, options, processOptions, async (err, info) => {
+ youtubeDL.getInfo(url, options, processOptions, (err, info) => {
if (err) return rej(err)
return res(info)