aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-15 15:30:14 +0200
committerChocobozzz <me@florianbigard.com>2022-07-18 11:37:18 +0200
commit42b40636991b97fe818007fab19091764fc5db73 (patch)
treedb431787c06ce898d22e91ff771f795219274fc6 /client/src/app/+videos
parent654d4ede7fa4d0faa71e49bcfab6b65a686397b2 (diff)
downloadPeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.gz
PeerTube-42b40636991b97fe818007fab19091764fc5db73.tar.zst
PeerTube-42b40636991b97fe818007fab19091764fc5db73.zip
Add ability for client to create server logs
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-edit/shared/video-edit.component.ts3
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts3
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts3
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts3
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts5
-rw-r--r--client/src/app/+videos/+video-edit/video-update.component.ts5
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts3
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts13
8 files changed, 23 insertions, 15 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 c74ef5731..99f8c9034 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
@@ -38,6 +38,7 @@ import { VideoCaptionAddModalComponent } from './video-caption-add-modal.compone
38import { VideoCaptionEditModalComponent } from './video-caption-edit-modal/video-caption-edit-modal.component' 38import { VideoCaptionEditModalComponent } from './video-caption-edit-modal/video-caption-edit-modal.component'
39import { VideoEditType } from './video-edit.type' 39import { VideoEditType } from './video-edit.type'
40import { VideoSource } from '@shared/models/videos/video-source' 40import { VideoSource } from '@shared/models/videos/video-source'
41import { logger } from '@root-helpers/logger'
41 42
42type VideoLanguages = VideoConstant<string> & { group?: string } 43type VideoLanguages = VideoConstant<string> & { group?: string }
43type PluginField = { 44type PluginField = {
@@ -443,7 +444,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
443 444
444 const oldChannel = this.userVideoChannels.find(c => c.id === oldChannelId) 445 const oldChannel = this.userVideoChannels.find(c => c.id === oldChannelId)
445 if (!newChannel || !oldChannel) { 446 if (!newChannel || !oldChannel) {
446 console.error('Cannot find new or old channel.') 447 logger.error('Cannot find new or old channel.')
447 return 448 return
448 } 449 }
449 450
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index 80e5a73da..91eb66931 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -7,6 +7,7 @@ import { FormValidatorService } from '@app/shared/shared-forms'
7import { Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' 7import { Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
8import { LiveVideoService } from '@app/shared/shared-video-live' 8import { LiveVideoService } from '@app/shared/shared-video-live'
9import { LoadingBarService } from '@ngx-loading-bar/core' 9import { LoadingBarService } from '@ngx-loading-bar/core'
10import { logger } from '@root-helpers/logger'
10import { LiveVideo, LiveVideoCreate, LiveVideoLatencyMode, LiveVideoUpdate, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models' 11import { LiveVideo, LiveVideoCreate, LiveVideoLatencyMode, LiveVideoUpdate, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
11import { VideoSend } from './video-send' 12import { VideoSend } from './video-send'
12 13
@@ -141,7 +142,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
141 error: err => { 142 error: err => {
142 this.error = err.message 143 this.error = err.message
143 scrollToTop() 144 scrollToTop()
144 console.error(err) 145 logger.error(err)
145 } 146 }
146 }) 147 })
147 } 148 }
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
index da4996902..7b9531d27 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -6,6 +6,7 @@ import { scrollToTop } from '@app/helpers'
6import { FormValidatorService } from '@app/shared/shared-forms' 6import { FormValidatorService } from '@app/shared/shared-forms'
7import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' 7import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
8import { LoadingBarService } from '@ngx-loading-bar/core' 8import { LoadingBarService } from '@ngx-loading-bar/core'
9import { logger } from '@root-helpers/logger'
9import { PeerTubeProblemDocument, ServerErrorCode, VideoUpdate } from '@shared/models' 10import { PeerTubeProblemDocument, ServerErrorCode, VideoUpdate } from '@shared/models'
10import { hydrateFormFromVideo } from '../shared/video-edit-utils' 11import { hydrateFormFromVideo } from '../shared/video-edit-utils'
11import { VideoSend } from './video-send' 12import { VideoSend } from './video-send'
@@ -139,7 +140,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
139 error: err => { 140 error: err => {
140 this.error = err.message 141 this.error = err.message
141 scrollToTop() 142 scrollToTop()
142 console.error(err) 143 logger.error(err)
143 } 144 }
144 }) 145 })
145 } 146 }
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
index 971a2a070..4ef7d1321 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -7,6 +7,7 @@ import { scrollToTop } from '@app/helpers'
7import { FormValidatorService } from '@app/shared/shared-forms' 7import { FormValidatorService } from '@app/shared/shared-forms'
8import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' 8import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
9import { LoadingBarService } from '@ngx-loading-bar/core' 9import { LoadingBarService } from '@ngx-loading-bar/core'
10import { logger } from '@root-helpers/logger'
10import { VideoUpdate } from '@shared/models' 11import { VideoUpdate } from '@shared/models'
11import { hydrateFormFromVideo } from '../shared/video-edit-utils' 12import { hydrateFormFromVideo } from '../shared/video-edit-utils'
12import { VideoSend } from './video-send' 13import { VideoSend } from './video-send'
@@ -128,7 +129,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV
128 error: err => { 129 error: err => {
129 this.error = err.message 130 this.error = err.message
130 scrollToTop() 131 scrollToTop()
131 console.error(err) 132 logger.error(err)
132 } 133 }
133 }) 134 })
134 } 135 }
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
index 663955d27..66a3967c7 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
@@ -1,6 +1,5 @@
1import { truncate } from 'lodash-es' 1import { truncate } from 'lodash-es'
2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx' 2import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx'
3import { isIOS } from '@root-helpers/web-browser'
4import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http' 3import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http'
5import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' 4import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
6import { ActivatedRoute, Router } from '@angular/router' 5import { ActivatedRoute, Router } from '@angular/router'
@@ -9,6 +8,8 @@ import { genericUploadErrorHandler, scrollToTop } from '@app/helpers'
9import { FormValidatorService } from '@app/shared/shared-forms' 8import { FormValidatorService } from '@app/shared/shared-forms'
10import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' 9import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
11import { LoadingBarService } from '@ngx-loading-bar/core' 10import { LoadingBarService } from '@ngx-loading-bar/core'
11import { logger } from '@root-helpers/logger'
12import { isIOS } from '@root-helpers/web-browser'
12import { HttpStatusCode, VideoCreateResult } from '@shared/models' 13import { HttpStatusCode, VideoCreateResult } from '@shared/models'
13import { UploaderXFormData } from './uploaderx-form-data' 14import { UploaderXFormData } from './uploaderx-form-data'
14import { VideoSend } from './video-send' 15import { VideoSend } from './video-send'
@@ -264,7 +265,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
264 error: err => { 265 error: err => {
265 this.error = err.message 266 this.error = err.message
266 scrollToTop() 267 scrollToTop()
267 console.error(err) 268 logger.error(err)
268 } 269 }
269 }) 270 })
270 } 271 }
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts
index 13e786a8e..ed17dff06 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -8,9 +8,10 @@ import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
8import { Video, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main' 8import { Video, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
9import { LiveVideoService } from '@app/shared/shared-video-live' 9import { LiveVideoService } from '@app/shared/shared-video-live'
10import { LoadingBarService } from '@ngx-loading-bar/core' 10import { LoadingBarService } from '@ngx-loading-bar/core'
11import { logger } from '@root-helpers/logger'
11import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models' 12import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
12import { hydrateFormFromVideo } from './shared/video-edit-utils'
13import { VideoSource } from '@shared/models/videos/video-source' 13import { VideoSource } from '@shared/models/videos/video-source'
14import { hydrateFormFromVideo } from './shared/video-edit-utils'
14 15
15@Component({ 16@Component({
16 selector: 'my-videos-update', 17 selector: 'my-videos-update',
@@ -156,7 +157,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
156 this.loadingBar.useRef().complete() 157 this.loadingBar.useRef().complete()
157 this.isUpdatingVideo = false 158 this.isUpdatingVideo = false
158 this.notifier.error(err.message) 159 this.notifier.error(err.message)
159 console.error(err) 160 logger.error(err)
160 } 161 }
161 }) 162 })
162 } 163 }
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts
index e002b3c22..b5444facb 100644
--- a/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-description.component.ts
@@ -1,6 +1,7 @@
1import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'
2import { MarkdownService, Notifier } from '@app/core' 2import { MarkdownService, Notifier } from '@app/core'
3import { VideoDetails, VideoService } from '@app/shared/shared-main' 3import { VideoDetails, VideoService } from '@app/shared/shared-main'
4import { logger } from '@root-helpers/logger'
4 5
5@Component({ 6@Component({
6 selector: 'my-video-description', 7 selector: 'my-video-description',
@@ -75,7 +76,7 @@ export class VideoDescriptionComponent implements OnChanges {
75 private updateVideoDescription (description: string) { 76 private updateVideoDescription (description: string) {
76 this.video.description = description 77 this.video.description = description
77 this.setVideoDescriptionHTML() 78 this.setVideoDescriptionHTML()
78 .catch(err => console.error(err)) 79 .catch(err => logger.error(err))
79 } 80 }
80 81
81 private async setVideoDescriptionHTML () { 82 private async setVideoDescriptionHTML () {
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 6a3bd1522..292ce6441 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -24,6 +24,7 @@ import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/sha
24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription' 24import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
25import { LiveVideoService } from '@app/shared/shared-video-live' 25import { LiveVideoService } from '@app/shared/shared-video-live'
26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist' 26import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
27import { logger } from '@root-helpers/logger'
27import { isP2PEnabled } from '@root-helpers/video' 28import { isP2PEnabled } from '@root-helpers/video'
28import { timeToInt } from '@shared/core-utils' 29import { timeToInt } from '@shared/core-utils'
29import { 30import {
@@ -225,7 +226,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
225 : parseInt(positionParam + '', 10) 226 : parseInt(positionParam + '', 10)
226 227
227 if (isNaN(this.playlistPosition)) { 228 if (isNaN(this.playlistPosition)) {
228 console.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`) 229 logger.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`)
229 this.playlistPosition = 1 230 this.playlistPosition = 1
230 } 231 }
231 232
@@ -378,7 +379,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
378 } 379 }
379 380
380 this.buildPlayer(urlOptions, loggedInOrAnonymousUser) 381 this.buildPlayer(urlOptions, loggedInOrAnonymousUser)
381 .catch(err => console.error('Cannot build the player', err)) 382 .catch(err => logger.error('Cannot build the player', err))
382 383
383 this.setOpenGraphTags() 384 this.setOpenGraphTags()
384 385
@@ -550,7 +551,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
550 this.player.dispose() 551 this.player.dispose()
551 this.player = undefined 552 this.player = undefined
552 } catch (err) { 553 } catch (err) {
553 console.error('Cannot dispose player.', err) 554 logger.error('Cannot dispose player.', err)
554 } 555 }
555 } 556 }
556 557
@@ -717,7 +718,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
717 private handleLiveStateChange (newState: VideoState) { 718 private handleLiveStateChange (newState: VideoState) {
718 if (newState !== VideoState.PUBLISHED) return 719 if (newState !== VideoState.PUBLISHED) return
719 720
720 console.log('Loading video after live update.') 721 logger.info('Loading video after live update.')
721 722
722 const videoUUID = this.video.uuid 723 const videoUUID = this.video.uuid
723 724
@@ -728,11 +729,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
728 729
729 private handleLiveViewsChange (newViewers: number) { 730 private handleLiveViewsChange (newViewers: number) {
730 if (!this.video) { 731 if (!this.video) {
731 console.error('Cannot update video live views because video is no defined.') 732 logger.error('Cannot update video live views because video is no defined.')
732 return 733 return
733 } 734 }
734 735
735 console.log('Updating live views.') 736 logger.info('Updating live views.')
736 737
737 this.video.viewers = newViewers 738 this.video.viewers = newViewers
738 } 739 }