Remove deprecated "views" from live video event
This commit is contained in:
parent
982edf32ae
commit
257df4cb56
|
@ -1,13 +1,13 @@
|
||||||
import { Server as HTTPServer } from 'http'
|
import { Server as HTTPServer } from 'http'
|
||||||
import { Namespace, Server as SocketServer, Socket } from 'socket.io'
|
import { Namespace, Server as SocketServer, Socket } from 'socket.io'
|
||||||
import { isIdValid } from '@server/helpers/custom-validators/misc'
|
import { isIdValid } from '@server/helpers/custom-validators/misc'
|
||||||
|
import { Debounce } from '@server/helpers/debounce'
|
||||||
import { MVideo, MVideoImmutable } from '@server/types/models'
|
import { MVideo, MVideoImmutable } from '@server/types/models'
|
||||||
import { MRunner } from '@server/types/models/runners'
|
import { MRunner } from '@server/types/models/runners'
|
||||||
import { UserNotificationModelForApi } from '@server/types/models/user'
|
import { UserNotificationModelForApi } from '@server/types/models/user'
|
||||||
import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models'
|
import { LiveVideoEventPayload, LiveVideoEventType } from '@shared/models'
|
||||||
import { logger } from '../helpers/logger'
|
import { logger } from '../helpers/logger'
|
||||||
import { authenticateRunnerSocket, authenticateSocket } from '../middlewares'
|
import { authenticateRunnerSocket, authenticateSocket } from '../middlewares'
|
||||||
import { Debounce } from '@server/helpers/debounce'
|
|
||||||
|
|
||||||
class PeerTubeSocket {
|
class PeerTubeSocket {
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ class PeerTubeSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
sendVideoViewsUpdate (video: MVideoImmutable, numViewers: number) {
|
sendVideoViewsUpdate (video: MVideoImmutable, numViewers: number) {
|
||||||
const data: LiveVideoEventPayload = { viewers: numViewers, views: numViewers }
|
const data: LiveVideoEventPayload = { viewers: numViewers }
|
||||||
const type: LiveVideoEventType = 'views-change'
|
const type: LiveVideoEventType = 'views-change'
|
||||||
|
|
||||||
logger.debug('Sending video live views update notification of %s.', video.url, { viewers: numViewers })
|
logger.debug('Sending video live views update notification of %s.', video.url, { viewers: numViewers })
|
||||||
|
|
|
@ -3,8 +3,5 @@ import { VideoState } from '../video-state.enum'
|
||||||
export interface LiveVideoEventPayload {
|
export interface LiveVideoEventPayload {
|
||||||
state?: VideoState
|
state?: VideoState
|
||||||
|
|
||||||
// FIXME: deprecated in 4.0 in favour of viewers
|
|
||||||
views?: number
|
|
||||||
|
|
||||||
viewers?: number
|
viewers?: number
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue