From f5a2dc48eb80ab7842cec1da7269b5d153208689 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 18 Jun 2018 09:42:16 +0200 Subject: Don't send view on private video --- client/src/app/videos/+video-edit/shared/video-edit.component.ts | 1 - client/src/app/videos/+video-watch/video-watch.component.ts | 4 ++-- client/src/assets/player/peertube-videojs-plugin.ts | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts index 24418fc4f..66eb6611a 100644 --- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts @@ -35,7 +35,6 @@ export class VideoEditComponent implements OnInit { schedulePublicationEnabled = false - error: string = null calendarLocale: any = {} minScheduledDate = new Date() diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 72e96ca93..6f6bd4e5d 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -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, diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index fe9fc1a69..b62dcb829 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -502,6 +502,8 @@ class PeerTubePlugin extends Plugin { } private addViewToVideo () { + if (!this.videoViewUrl) return Promise.resolve(undefined) + return fetch(this.videoViewUrl, { method: 'POST' }) } -- cgit v1.2.3