1
0
Fork 0

Don't send view on private video

This commit is contained in:
Chocobozzz 2018-06-18 09:42:16 +02:00
parent b7f1747dc7
commit f5a2dc48eb
No known key found for this signature in database
GPG key ID: 583A612D890159BE
3 changed files with 4 additions and 3 deletions

View file

@ -35,7 +35,6 @@ export class VideoEditComponent implements OnInit {
schedulePublicationEnabled = false
error: string = null
calendarLocale: any = {}
minScheduledDate = new Date()

View file

@ -10,7 +10,7 @@ import { Subscription } from 'rxjs'
import * as videojs from 'video.js'
import 'videojs-hotkeys'
import * as WebTorrent from 'webtorrent'
import { UserVideoRateType, VideoRateType, VideoState } from '../../../../../shared'
import { UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared'
import '../../../assets/player/peertube-videojs-plugin'
import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared'
@ -368,7 +368,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
inactivityTimeout: 2500,
videoFiles: this.video.files,
playerElement: this.playerElement,
videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid),
videoViewUrl: this.video.privacy.id !== VideoPrivacy.PRIVATE ? this.videoService.getVideoViewUrl(this.video.uuid) : null,
videoDuration: this.video.duration,
enableHotkeys: true,
peertubeLink: false,

View file

@ -502,6 +502,8 @@ class PeerTubePlugin extends Plugin {
}
private addViewToVideo () {
if (!this.videoViewUrl) return Promise.resolve(undefined)
return fetch(this.videoViewUrl, { method: 'POST' })
}