From: Chocobozzz Date: Mon, 18 Jun 2018 07:42:16 +0000 (+0200) Subject: Don't send view on private video X-Git-Tag: v1.0.0-beta.9~32 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f5a2dc48eb80ab7842cec1da7269b5d153208689;p=oweals%2Fpeertube.git Don't send view on private video --- 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' }) }