-
+ |
No follower found matching current filters.
Your instance doesn't have any follower.
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
index 329e3bcc7..b2d333e83 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -1,7 +1,10 @@
import { SortMeta } from 'primeng/api'
import { Component, OnInit } from '@angular/core'
import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
+import { prepareIcu } from '@app/helpers'
+import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { InstanceFollowService } from '@app/shared/shared-instance'
+import { DropdownAction } from '@app/shared/shared-main'
import { ActorFollow } from '@shared/models'
@Component({
@@ -15,6 +18,11 @@ export class FollowersListComponent extends RestTable implements OnInit {
sort: SortMeta = { field: 'createdAt', order: -1 }
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
+ searchFilters: AdvancedInputFilter[] = []
+
+ selectedFollows: ActorFollow[] = []
+ bulkFollowsActions: DropdownAction [] = []
+
constructor (
private confirmService: ConfirmService,
private notifier: Notifier,
@@ -25,60 +33,69 @@ export class FollowersListComponent extends RestTable implements OnInit {
ngOnInit () {
this.initialize()
+
+ this.searchFilters = this.followService.buildFollowsListFilters()
+
+ this.bulkFollowsActions = [
+ {
+ label: $localize`Reject`,
+ handler: follows => this.rejectFollower(follows),
+ isDisplayed: follows => follows.every(f => f.state !== 'rejected')
+ },
+ {
+ label: $localize`Accept`,
+ handler: follows => this.acceptFollower(follows),
+ isDisplayed: follows => follows.every(f => f.state !== 'accepted')
+ },
+ {
+ label: $localize`Delete`,
+ handler: follows => this.deleteFollowers(follows),
+ isDisplayed: follows => follows.every(f => f.state === 'rejected')
+ }
+ ]
}
getIdentifier () {
return 'FollowersListComponent'
}
- acceptFollower (follow: ActorFollow) {
- follow.state = 'accepted'
-
- this.followService.acceptFollower(follow)
+ acceptFollower (follows: ActorFollow[]) {
+ this.followService.acceptFollower(follows)
.subscribe({
next: () => {
- const handle = follow.follower.name + '@' + follow.follower.host
- this.notifier.success($localize`${handle} accepted in instance followers`)
+ // eslint-disable-next-line max-len
+ const message = prepareIcu($localize`Accepted {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}`)(
+ { count: follows.length, followerName: this.buildFollowerName(follows[0]) },
+ $localize`Follow requests accepted`
+ )
+ this.notifier.success(message)
+
+ this.reloadData()
},
- error: err => {
- follow.state = 'pending'
- this.notifier.error(err.message)
- }
+ error: err => this.notifier.error(err.message)
})
}
- async rejectFollower (follow: ActorFollow) {
- const message = $localize`Do you really want to reject this follower?`
+ async rejectFollower (follows: ActorFollow[]) {
+ // eslint-disable-next-line max-len
+ const message = prepareIcu($localize`Do you really want to reject {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}`)(
+ { count: follows.length, followerName: this.buildFollowerName(follows[0]) },
+ $localize`Do you really want to reject these follow requests?`
+ )
+
const res = await this.confirmService.confirm(message, $localize`Reject`)
if (res === false) return
- this.followService.rejectFollower(follow)
+ this.followService.rejectFollower(follows)
.subscribe({
next: () => {
- const handle = follow.follower.name + '@' + follow.follower.host
- this.notifier.success($localize`${handle} rejected from instance followers`)
-
- this.reloadData()
- },
-
- error: err => {
- follow.state = 'pending'
- this.notifier.error(err.message)
- }
- })
- }
-
- async deleteFollower (follow: ActorFollow) {
- const message = $localize`Do you really want to delete this follower?`
- const res = await this.confirmService.confirm(message, $localize`Delete`)
- if (res === false) return
-
- this.followService.removeFollower(follow)
- .subscribe({
- next: () => {
- const handle = follow.follower.name + '@' + follow.follower.host
- this.notifier.success($localize`${handle} removed from instance followers`)
+ // eslint-disable-next-line max-len
+ const message = prepareIcu($localize`Rejected {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}`)(
+ { count: follows.length, followerName: this.buildFollowerName(follows[0]) },
+ $localize`Follow requests rejected`
+ )
+ this.notifier.success(message)
this.reloadData()
},
@@ -87,6 +104,45 @@ export class FollowersListComponent extends RestTable implements OnInit {
})
}
+ async deleteFollowers (follows: ActorFollow[]) {
+ let message = $localize`Deleted followers will be able to send again a follow request.`
+ message += '
'
+
+ // eslint-disable-next-line max-len
+ message += prepareIcu($localize`Do you really want to delete {count, plural, =1 {{followerName} follow request?} other {{count} follow requests?}}`)(
+ { count: follows.length, followerName: this.buildFollowerName(follows[0]) },
+ $localize`Do you really want to delete these follow requests?`
+ )
+
+ const res = await this.confirmService.confirm(message, $localize`Delete`)
+ if (res === false) return
+
+ this.followService.removeFollower(follows)
+ .subscribe({
+ next: () => {
+ // eslint-disable-next-line max-len
+ const message = prepareIcu($localize`Removed {count, plural, =1 {{followerName} follow request} other {{count} follow requests}}`)(
+ { count: follows.length, followerName: this.buildFollowerName(follows[0]) },
+ $localize`Follow requests removed`
+ )
+
+ this.notifier.success(message)
+
+ this.reloadData()
+ },
+
+ error: err => this.notifier.error(err.message)
+ })
+ }
+
+ buildFollowerName (follow: ActorFollow) {
+ return follow.follower.name + '@' + follow.follower.host
+ }
+
+ isInSelectionMode () {
+ return this.selectedFollows.length !== 0
+ }
+
protected reloadData () {
this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search })
.subscribe({
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html
index 106e1805e..4554bf151 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.html
+++ b/client/src/app/+admin/follows/following-list/following-list.component.html
@@ -4,29 +4,39 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
+ [value]="following" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
[lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} hosts"
+ [(selection)]="selectedFollows"
>
+
+
+ |
Action |
Following |
State |
@@ -35,23 +45,26 @@
-
+
+
+
+ |
+
-
+
|
- {{ follow.following.name + '@' + follow.following.host }}
+ {{ buildFollowingName(follow) }}
|
-
- Accepted
- |
-
- Pending
+ |
+ Accepted
+ Pending
+ Rejected
|
{{ follow.createdAt | date: 'short' }} |
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index 2c0f6db0c..e3a56651a 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -1,9 +1,12 @@
import { SortMeta } from 'primeng/api'
import { Component, OnInit, ViewChild } from '@angular/core'
import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
+import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { InstanceFollowService } from '@app/shared/shared-instance'
import { ActorFollow } from '@shared/models'
import { FollowModalComponent } from './follow-modal.component'
+import { DropdownAction } from '@app/shared/shared-main'
+import { prepareIcu } from '@app/helpers'
@Component({
templateUrl: './following-list.component.html',
@@ -17,6 +20,11 @@ export class FollowingListComponent extends RestTable implements OnInit {
sort: SortMeta = { field: 'createdAt', order: -1 }
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
+ searchFilters: AdvancedInputFilter[] = []
+
+ selectedFollows: ActorFollow[] = []
+ bulkFollowsActions: DropdownAction[] = []
+
constructor (
private notifier: Notifier,
private confirmService: ConfirmService,
@@ -27,6 +35,15 @@ export class FollowingListComponent extends RestTable implements OnInit {
ngOnInit () {
this.initialize()
+
+ this.searchFilters = this.followService.buildFollowsListFilters()
+
+ this.bulkFollowsActions = [
+ {
+ label: $localize`Delete`,
+ handler: follows => this.removeFollowing(follows)
+ }
+ ]
}
getIdentifier () {
@@ -41,17 +58,33 @@ export class FollowingListComponent extends RestTable implements OnInit {
return follow.following.name === 'peertube'
}
- async removeFollowing (follow: ActorFollow) {
- const res = await this.confirmService.confirm(
- $localize`Do you really want to unfollow ${follow.following.host}?`,
- $localize`Unfollow`
+ isInSelectionMode () {
+ return this.selectedFollows.length !== 0
+ }
+
+ buildFollowingName (follow: ActorFollow) {
+ return follow.following.name + '@' + follow.following.host
+ }
+
+ async removeFollowing (follows: ActorFollow[]) {
+ const message = prepareIcu($localize`Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}`)(
+ { count: follows.length, entryName: this.buildFollowingName(follows[0]) },
+ $localize`Do you really want to unfollow these entries?`
)
+
+ const res = await this.confirmService.confirm(message, $localize`Unfollow`)
if (res === false) return
- this.followService.unfollow(follow)
+ this.followService.unfollow(follows)
.subscribe({
next: () => {
- this.notifier.success($localize`You are not following ${follow.following.host} anymore.`)
+ // eslint-disable-next-line max-len
+ const message = prepareIcu($localize`You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}`)(
+ { count: follows.length, entryName: this.buildFollowingName(follows[0]) },
+ $localize`You are not following them anymore.`
+ )
+
+ this.notifier.success(message)
this.reloadData()
},
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
index 12b07da11..8d669b62d 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.html
@@ -17,7 +17,8 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
+ [value]="videoRedundancies" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords"
+ [rows]="rowsPerPage" [first]="pagination.start" [rowsPerPageOptions]="rowsPerPageOptions"
[sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
[expandedRowKeys]="expandedRows"
>
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
index b302014b6..28109d007 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html
@@ -4,8 +4,8 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
+ [value]="blocklist" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
[lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} blocked videos"
diff --git a/client/src/app/+admin/overview/comments/video-comment-list.component.html b/client/src/app/+admin/overview/comments/video-comment-list.component.html
index b7fc0a1eb..d2ca5f700 100644
--- a/client/src/app/+admin/overview/comments/video-comment-list.component.html
+++ b/client/src/app/+admin/overview/comments/video-comment-list.component.html
@@ -8,8 +8,8 @@
This view also shows comments from muted accounts.
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
+ [value]="comments" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id"
[lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} comments"
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.html b/client/src/app/+admin/overview/users/user-list/user-list.component.html
index aa3def63a..c7af7dfae 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.html
@@ -4,9 +4,9 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedUsers"
- [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
+ [value]="users" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
+ [(selection)]="selectedUsers" [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} users"
[expandedRowKeys]="expandedRows"
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
index 3e1a5f6b8..99987fdff 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
@@ -2,11 +2,12 @@ import { SortMeta } from 'primeng/api'
import { Component, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { AuthService, ConfirmService, LocalStorageService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
-import { prepareIcu, getAPIHost } from '@app/helpers'
+import { getAPIHost, prepareIcu } from '@app/helpers'
import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { Actor, DropdownAction } from '@app/shared/shared-main'
import { AccountMutedStatus, BlocklistService, UserBanModalComponent, UserModerationDisplayType } from '@app/shared/shared-moderation'
import { UserAdminService } from '@app/shared/shared-users'
+import { logger } from '@root-helpers/logger'
import { User, UserRole } from '@shared/models'
type UserForList = User & {
@@ -149,7 +150,7 @@ export class UserListComponent extends RestTable implements OnInit {
this.selectedColumns = JSON.parse(result)
return
} catch (err) {
- console.error('Cannot load selected columns.', err)
+ logger.error('Cannot load selected columns.', err)
}
}
diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.html
index 2f36c27b7..06b9ab347 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.html
+++ b/client/src/app/+admin/overview/videos/video-list.component.html
@@ -4,9 +4,9 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true" [(selection)]="selectedVideos"
- [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
+ [value]="videos" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" dataKey="id" [resizableColumns]="true"
+ [(selection)]="selectedVideos" [lazy]="true" (onLazyLoad)="loadLazy($event)" [lazyLoadOnInit]="false" [selectionPageOnly]="true"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} videos"
[expandedRowKeys]="expandedRows" [ngClass]="{ loading: loading }"
@@ -107,6 +107,11 @@
-
{{ file.resolution.label }}: {{ file.size | bytes: 1 }}
+
+
@@ -117,6 +122,11 @@
-
{{ file.resolution.label }}: {{ file.size | bytes: 1 }}
+
+
diff --git a/client/src/app/+admin/overview/videos/video-list.component.scss b/client/src/app/+admin/overview/videos/video-list.component.scss
index dcd41a1b4..d538ca30a 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.scss
+++ b/client/src/app/+admin/overview/videos/video-list.component.scss
@@ -13,6 +13,13 @@ my-embed {
.video-info > div {
display: flex;
+
+ my-global-icon {
+ width: 16px;
+ margin-left: 3px;
+ position: relative;
+ top: -2px;
+ }
}
.loading {
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index 67e52d100..ed7ec54a1 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -8,7 +8,7 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms'
import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation'
import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
-import { UserRight, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
+import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
import { VideoAdminService } from './video-admin.service'
@Component({
@@ -196,6 +196,22 @@ export class VideoListComponent extends RestTable implements OnInit {
})
}
+ async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
+ const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
+ const res = await this.confirmService.confirm(message, $localize`Delete file`)
+ if (res === false) return
+
+ this.videoService.removeFile(video.uuid, file.id, type)
+ .subscribe({
+ next: () => {
+ this.notifier.success($localize`File removed.`)
+ this.reloadData()
+ },
+
+ error: err => this.notifier.error(err.message)
+ })
+ }
+
private async removeVideos (videos: Video[]) {
const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)(
{ count: videos.length },
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
index d39c2ea1c..b02c054a2 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
@@ -4,6 +4,7 @@ import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core'
+import { logger } from '@root-helpers/logger'
import { PeerTubePluginIndex, PluginType } from '@shared/models'
@Component({
@@ -94,7 +95,7 @@ export class PluginSearchComponent implements OnInit {
},
error: err => {
- console.error(err)
+ logger.error(err)
const message = $localize`The plugin index is not available. Please retry later.`
this.notifier.error(message)
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index 1a40f6c65..ec02cfcd9 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -111,7 +111,7 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit
this.form.patchValue(settingsValues)
- setTimeout(() => this.hooks.runAction('action:admin-plugin-settings.init', 'admin-plugin', { npmName: this.npmName }))
+ this.hooks.runAction('action:admin-plugin-settings.init', 'admin-plugin', { npmName: this.npmName })
}
private getSetting (name: string) {
diff --git a/client/src/app/+admin/system/jobs/jobs.component.html b/client/src/app/+admin/system/jobs/jobs.component.html
index 8068fe626..b53fafeba 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.html
+++ b/client/src/app/+admin/system/jobs/jobs.component.html
@@ -32,9 +32,9 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="uniqId" [first]="pagination.start"
- [tableStyle]="{'table-layout':'auto'}"
+ [value]="jobs" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order"
+ (onLazyLoad)="loadLazy($event)" dataKey="uniqId" [first]="pagination.start" [tableStyle]="{'table-layout':'auto'}"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} jobs"
[expandedRowKeys]="expandedRows"
@@ -42,7 +42,7 @@
|
- ID |
+ ID |
Type |
Priority (1 = highest priority) |
State |
diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts
index 615778210..e83c7b064 100644
--- a/client/src/app/+admin/system/logs/log-row.model.ts
+++ b/client/src/app/+admin/system/logs/log-row.model.ts
@@ -1,10 +1,11 @@
-import { LogLevel } from '@shared/models'
import omit from 'lodash-es/omit'
+import { logger } from '@root-helpers/logger'
+import { ServerLogLevel } from '@shared/models'
export class LogRow {
date: Date
localeDate: string
- level: LogLevel
+ level: ServerLogLevel
message: string
meta: string
@@ -33,7 +34,7 @@ export class LogRow {
this.meta = JSON.stringify(message, null, 2)
this.message = ''
} catch (err) {
- console.error('Cannot parse audit message.', err)
+ logger.error('Cannot parse audit message.', err)
}
}
}
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts
index 06237522a..939e710d7 100644
--- a/client/src/app/+admin/system/logs/logs.component.ts
+++ b/client/src/app/+admin/system/logs/logs.component.ts
@@ -1,6 +1,6 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
import { LocalStorageService, Notifier } from '@app/core'
-import { LogLevel } from '@shared/models'
+import { ServerLogLevel } from '@shared/models'
import { LogRow } from './log-row.model'
import { LogsService } from './logs.service'
@@ -17,11 +17,11 @@ export class LogsComponent implements OnInit {
logs: LogRow[] = []
timeChoices: { id: string, label: string, dateFormat: string }[] = []
- levelChoices: { id: LogLevel, label: string }[] = []
+ levelChoices: { id: ServerLogLevel, label: string }[] = []
logTypeChoices: { id: 'audit' | 'standard', label: string }[] = []
startDate: string
- level: LogLevel
+ level: ServerLogLevel
logType: 'audit' | 'standard'
tagsOneOf: string[] = []
diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts
index ea7e08b9b..933a074a8 100644
--- a/client/src/app/+admin/system/logs/logs.service.ts
+++ b/client/src/app/+admin/system/logs/logs.service.ts
@@ -3,7 +3,7 @@ import { catchError, map } from 'rxjs/operators'
import { HttpClient, HttpParams } from '@angular/common/http'
import { Injectable } from '@angular/core'
import { RestExtractor, RestService } from '@app/core'
-import { LogLevel } from '@shared/models'
+import { ServerLogLevel } from '@shared/models'
import { environment } from '../../../../environments/environment'
import { LogRow } from './log-row.model'
@@ -22,7 +22,7 @@ export class LogsService {
isAuditLog: boolean
startDate: string
tagsOneOf?: string[]
- level?: LogLevel
+ level?: ServerLogLevel
endDate?: string
}): Observable {
const { isAuditLog, startDate, endDate, tagsOneOf } = options
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts b/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
index 5f8e0278e..8211451a4 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
+++ b/client/src/app/+manage/video-channel-edit/video-channel-create.component.ts
@@ -1,8 +1,8 @@
import { of } from 'rxjs'
import { switchMap } from 'rxjs/operators'
-import { Component, OnInit } from '@angular/core'
+import { AfterViewInit, Component, OnInit } from '@angular/core'
import { Router } from '@angular/router'
-import { AuthService, Notifier } from '@app/core'
+import { AuthService, HooksService, Notifier } from '@app/core'
import {
VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
VIDEO_CHANNEL_DISPLAY_NAME_VALIDATOR,
@@ -18,7 +18,7 @@ import { VideoChannelEdit } from './video-channel-edit'
templateUrl: './video-channel-edit.component.html',
styleUrls: [ './video-channel-edit.component.scss' ]
})
-export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit {
+export class VideoChannelCreateComponent extends VideoChannelEdit implements OnInit, AfterViewInit {
error: string
videoChannel = new VideoChannel({})
@@ -30,7 +30,8 @@ export class VideoChannelCreateComponent extends VideoChannelEdit implements OnI
private authService: AuthService,
private notifier: Notifier,
private router: Router,
- private videoChannelService: VideoChannelService
+ private videoChannelService: VideoChannelService,
+ private hooks: HooksService
) {
super()
}
@@ -44,6 +45,10 @@ export class VideoChannelCreateComponent extends VideoChannelEdit implements OnI
})
}
+ ngAfterViewInit () {
+ this.hooks.runAction('action:video-channel-create.init', 'video-channel')
+ }
+
formValidated () {
this.error = undefined
diff --git a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts b/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts
index 6b4947912..7e8d6ffe6 100644
--- a/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts
+++ b/client/src/app/+manage/video-channel-edit/video-channel-update.component.ts
@@ -1,8 +1,8 @@
import { Subscription } from 'rxjs'
import { HttpErrorResponse } from '@angular/common/http'
-import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ActivatedRoute, Router } from '@angular/router'
-import { AuthService, Notifier, RedirectService, ServerService } from '@app/core'
+import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'
+import { ActivatedRoute } from '@angular/router'
+import { AuthService, HooksService, Notifier, RedirectService, ServerService } from '@app/core'
import { genericUploadErrorHandler } from '@app/helpers'
import {
VIDEO_CHANNEL_DESCRIPTION_VALIDATOR,
@@ -19,7 +19,7 @@ import { VideoChannelEdit } from './video-channel-edit'
templateUrl: './video-channel-edit.component.html',
styleUrls: [ './video-channel-edit.component.scss' ]
})
-export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, OnDestroy {
+export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnInit, AfterViewInit, OnDestroy {
error: string
videoChannel: VideoChannel
@@ -31,11 +31,11 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI
protected formValidatorService: FormValidatorService,
private authService: AuthService,
private notifier: Notifier,
- private router: Router,
private route: ActivatedRoute,
private videoChannelService: VideoChannelService,
private serverService: ServerService,
- private redirectService: RedirectService
+ private redirectService: RedirectService,
+ private hooks: HooksService
) {
super()
}
@@ -58,6 +58,8 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI
next: videoChannelToUpdate => {
this.videoChannel = videoChannelToUpdate
+ this.hooks.runAction('action:video-channel-update.video-channel.loaded', 'video-channel', { videoChannel: this.videoChannel })
+
this.oldSupportField = videoChannelToUpdate.support
this.form.patchValue({
@@ -74,6 +76,10 @@ export class VideoChannelUpdateComponent extends VideoChannelEdit implements OnI
})
}
+ ngAfterViewInit () {
+ this.hooks.runAction('action:video-channel-update.init', 'video-channel')
+ }
+
ngOnDestroy () {
if (this.paramsSub) this.paramsSub.unsubscribe()
}
diff --git a/client/src/app/+my-library/my-ownership/my-ownership.component.html b/client/src/app/+my-library/my-ownership/my-ownership.component.html
index 649b3fef1..d9a4f32bd 100644
--- a/client/src/app/+my-library/my-ownership/my-ownership.component.html
+++ b/client/src/app/+my-library/my-ownership/my-ownership.component.html
@@ -4,14 +4,8 @@
0"
- [totalRecords]="totalRecords"
- [rows]="rowsPerPage"
- [sortField]="sort.field"
- [sortOrder]="sort.order"
- (onLazyLoad)="loadLazy($event)"
+ [value]="videoChangeOwnerships" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage"
+ [first]="pagination.start" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)"
>
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
index 79fb4da26..fb0f6f5a3 100644
--- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
+++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.html
@@ -4,8 +4,8 @@
0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [rowsPerPageOptions]="rowsPerPageOptions"
- [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
+ [value]="videoImports" [lazy]="true" [paginator]="totalRecords > 0" [totalRecords]="totalRecords" [rows]="rowsPerPage" [first]="pagination.start"
+ [rowsPerPageOptions]="rowsPerPageOptions" [sortField]="sort.field" [sortOrder]="sort.order" (onLazyLoad)="loadLazy($event)" dataKey="id"
[showCurrentPageReport]="true" i18n-currentPageReportTemplate
currentPageReportTemplate="Showing {{'{first}'}} to {{'{last}'}} of {{'{totalRecords}'}} imports"
[expandedRowKeys]="expandedRows"
diff --git a/client/src/app/+plugin-pages/plugin-pages.component.ts b/client/src/app/+plugin-pages/plugin-pages.component.ts
index 973e4d021..9fe4b413e 100644
--- a/client/src/app/+plugin-pages/plugin-pages.component.ts
+++ b/client/src/app/+plugin-pages/plugin-pages.component.ts
@@ -1,6 +1,7 @@
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { PluginService } from '@app/core'
+import { logger } from '@root-helpers/logger'
@Component({
templateUrl: './plugin-pages.component.html'
@@ -26,7 +27,7 @@ export class PluginPagesComponent implements AfterViewInit {
const registered = this.pluginService.getRegisteredClientRoute(path)
if (!registered) {
- console.log('Could not find registered route %s.', path, this.pluginService.getAllRegisteredClientRoutes())
+ logger.info(`Could not find registered route ${path}`, this.pluginService.getAllRegisteredClientRoutes())
return this.router.navigate([ '/404' ], { skipLocationChange: true })
}
diff --git a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts
index b18a5b64d..7551d977d 100644
--- a/client/src/app/+search/shared/abstract-lazy-load.resolver.ts
+++ b/client/src/app/+search/shared/abstract-lazy-load.resolver.ts
@@ -1,6 +1,7 @@
import { Observable } from 'rxjs'
import { map } from 'rxjs/operators'
import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router'
+import { logger } from '@root-helpers/logger'
import { ResultList } from '@shared/models'
export abstract class AbstractLazyLoadResolver implements Resolve {
@@ -10,7 +11,7 @@ export abstract class AbstractLazyLoadResolver implements Resolve {
const url = route.params.url
if (!url) {
- console.error('Could not find url param.', { params: route.params })
+ logger.error('Could not find url param.', { params: route.params })
return this.router.navigateByUrl('/404')
}
@@ -18,7 +19,7 @@ export abstract class AbstractLazyLoadResolver implements Resolve {
.pipe(
map(result => {
if (result.data.length !== 1) {
- console.error('Cannot find result for this URL')
+ logger.error('Cannot find result for this URL')
return this.router.navigateByUrl('/404')
}
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
index 14465bb8d..82af65026 100644
--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
@@ -1,6 +1,6 @@
import { Subject, Subscription } from 'rxjs'
-import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ComponentPagination, hasMoreItems, ScreenService } from '@app/core'
+import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'
+import { ComponentPagination, hasMoreItems, HooksService, ScreenService } from '@app/core'
import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
@@ -9,7 +9,7 @@ import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-pl
templateUrl: './video-channel-playlists.component.html',
styleUrls: [ './video-channel-playlists.component.scss' ]
})
-export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
+export class VideoChannelPlaylistsComponent implements OnInit, AfterViewInit, OnDestroy {
videoPlaylists: VideoPlaylist[] = []
pagination: ComponentPagination = {
@@ -26,16 +26,24 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
constructor (
private videoPlaylistService: VideoPlaylistService,
private videoChannelService: VideoChannelService,
- private screenService: ScreenService
+ private screenService: ScreenService,
+ private hooks: HooksService
) {}
ngOnInit () {
// Parent get the video channel for us
this.videoChannelSub = this.videoChannelService.videoChannelLoaded
- .subscribe(videoChannel => {
- this.videoChannel = videoChannel
- this.loadVideoPlaylists()
- })
+ .subscribe(videoChannel => {
+ this.videoChannel = videoChannel
+
+ this.hooks.runAction('action:video-channel-playlists.video-channel.loaded', 'video-channel', { videoChannel })
+
+ this.loadVideoPlaylists()
+ })
+ }
+
+ ngAfterViewInit () {
+ this.hooks.runAction('action:video-channel-playlists.init', 'video-channel')
}
ngOnDestroy () {
@@ -55,11 +63,13 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
private loadVideoPlaylists () {
this.videoPlaylistService.listChannelPlaylists(this.videoChannel, this.pagination)
- .subscribe(res => {
- this.videoPlaylists = this.videoPlaylists.concat(res.data)
- this.pagination.totalItems = res.total
+ .subscribe(res => {
+ this.videoPlaylists = this.videoPlaylists.concat(res.data)
+ this.pagination.totalItems = res.total
- this.onDataSubject.next(res.data)
- })
+ this.hooks.runAction('action:video-channel-playlists.playlists.loaded', 'video-channel', { playlists: this.videoPlaylists })
+
+ this.onDataSubject.next(res.data)
+ })
}
}
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
index 0a6c5fcb2..9e9e98c99 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html
@@ -19,5 +19,7 @@
[loadUserVideoPreferences]="true"
[disabled]="disabled"
+
+ (videosLoaded)="onVideosLoaded($event)"
>
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
index 43fce475d..5e3946bf5 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
@@ -1,16 +1,16 @@
import { Subscription } from 'rxjs'
import { first } from 'rxjs/operators'
-import { Component, OnDestroy, OnInit } from '@angular/core'
-import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core'
+import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'
+import { ComponentPaginationLight, DisableForReuseHook, HooksService, ScreenService } from '@app/core'
import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
import { MiniatureDisplayOptions, VideoFilters } from '@app/shared/shared-video-miniature'
-import { VideoSortField } from '@shared/models/videos'
+import { Video, VideoSortField } from '@shared/models'
@Component({
selector: 'my-video-channel-videos',
templateUrl: './video-channel-videos.component.html'
})
-export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableForReuseHook {
+export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDestroy, DisableForReuseHook {
getVideosObservableFunction = this.getVideosObservable.bind(this)
getSyndicationItemsFunction = this.getSyndicationItems.bind(this)
@@ -36,7 +36,8 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo
constructor (
private screenService: ScreenService,
private videoChannelService: VideoChannelService,
- private videoService: VideoService
+ private videoService: VideoService,
+ private hooks: HooksService
) {
}
@@ -45,9 +46,15 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo
this.videoChannelService.videoChannelLoaded.pipe(first())
.subscribe(videoChannel => {
this.videoChannel = videoChannel
+
+ this.hooks.runAction('action:video-channel-videos.video-channel.loaded', 'video-channel', { videoChannel })
})
}
+ ngAfterViewInit () {
+ this.hooks.runAction('action:video-channel-videos.init', 'video-channel')
+ }
+
ngOnDestroy () {
if (this.videoChannelSub) this.videoChannelSub.unsubscribe()
}
@@ -79,4 +86,8 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo
enabledForReuse () {
this.disabled = false
}
+
+ onVideosLoaded (videos: Video[]) {
+ this.hooks.runAction('action:video-channel-videos.videos.loaded', 'video-channel', { videos })
+ }
}
diff --git a/client/src/app/+video-studio/edit/video-studio-edit.component.ts b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
index 392b65767..bf91c237a 100644
--- a/client/src/app/+video-studio/edit/video-studio-edit.component.ts
+++ b/client/src/app/+video-studio/edit/video-studio-edit.component.ts
@@ -4,6 +4,7 @@ import { ConfirmService, Notifier, ServerService } from '@app/core'
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
import { VideoDetails } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
import { secondsToTime } from '@shared/core-utils'
import { VideoStudioTask, VideoStudioTaskCut } from '@shared/models'
import { VideoStudioService } from '../shared'
@@ -97,7 +98,7 @@ export class VideoStudioEditComponent extends FormReactive implements OnInit {
this.loadingBar.useRef().complete()
this.isRunningEdition = false
this.notifier.error(err.message)
- console.error(err)
+ logger.error(err)
}
})
}
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
index 650448a74..2892d603d 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
@@ -183,7 +183,7 @@
[href]="videoCaption.captionPath"
>{{ videoCaption.language.label }}
- Already uploaded ✔
+ Already uploaded on {{ videoCaption.updatedAt | date }} ✔
Edit
Delete
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.scss b/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
index e8a6c6e42..a8075cc6d 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.scss
@@ -41,7 +41,6 @@ my-peertube-checkbox {
a.caption-entry-label {
@include disable-default-a-behaviour;
- flex-grow: 1;
color: #000;
&:hover {
@@ -53,11 +52,13 @@ my-peertube-checkbox {
@include margin-right(20px);
font-weight: bold;
- width: 150px;
+ min-width: 100px;
}
.caption-entry-state {
- width: 200px;
+ @include margin-right(15px);
+
+ min-width: 250px;
&.caption-entry-state-create {
color: #39CC0B;
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
import { VideoCaptionEditModalComponent } from './video-caption-edit-modal/video-caption-edit-modal.component'
import { VideoEditType } from './video-edit.type'
import { VideoSource } from '@shared/models/videos/video-source'
+import { logger } from '@root-helpers/logger'
type VideoLanguages = VideoConstant & { group?: string }
type PluginField = {
@@ -443,7 +444,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
const oldChannel = this.userVideoChannels.find(c => c.id === oldChannelId)
if (!newChannel || !oldChannel) {
- console.error('Cannot find new or old channel.')
+ logger.error('Cannot find new or old channel.')
return
}
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'
import { Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LiveVideoService } from '@app/shared/shared-video-live'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
import { LiveVideo, LiveVideoCreate, LiveVideoLatencyMode, LiveVideoUpdate, PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
import { VideoSend } from './video-send'
@@ -141,7 +142,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
error: err => {
this.error = err.message
scrollToTop()
- console.error(err)
+ logger.error(err)
}
})
}
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'
import { FormValidatorService } from '@app/shared/shared-forms'
import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
import { PeerTubeProblemDocument, ServerErrorCode, VideoUpdate } from '@shared/models'
import { hydrateFormFromVideo } from '../shared/video-edit-utils'
import { VideoSend } from './video-send'
@@ -139,7 +140,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
error: err => {
this.error = err.message
scrollToTop()
- console.error(err)
+ logger.error(err)
}
})
}
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'
import { FormValidatorService } from '@app/shared/shared-forms'
import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
import { VideoUpdate } from '@shared/models'
import { hydrateFormFromVideo } from '../shared/video-edit-utils'
import { VideoSend } from './video-send'
@@ -128,7 +129,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV
error: err => {
this.error = err.message
scrollToTop()
- console.error(err)
+ logger.error(err)
}
})
}
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 @@
import { truncate } from 'lodash-es'
import { UploadState, UploadxOptions, UploadxService } from 'ngx-uploadx'
-import { isIOS } from '@root-helpers/web-browser'
import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http'
import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
@@ -9,6 +8,8 @@ import { genericUploadErrorHandler, scrollToTop } from '@app/helpers'
import { FormValidatorService } from '@app/shared/shared-forms'
import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
+import { isIOS } from '@root-helpers/web-browser'
import { HttpStatusCode, VideoCreateResult } from '@shared/models'
import { UploaderXFormData } from './uploaderx-form-data'
import { VideoSend } from './video-send'
@@ -264,7 +265,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
error: err => {
this.error = err.message
scrollToTop()
- console.error(err)
+ logger.error(err)
}
})
}
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'
import { Video, VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LiveVideoService } from '@app/shared/shared-video-live'
import { LoadingBarService } from '@ngx-loading-bar/core'
+import { logger } from '@root-helpers/logger'
import { LiveVideo, LiveVideoUpdate, VideoPrivacy } from '@shared/models'
-import { hydrateFormFromVideo } from './shared/video-edit-utils'
import { VideoSource } from '@shared/models/videos/video-source'
+import { hydrateFormFromVideo } from './shared/video-edit-utils'
@Component({
selector: 'my-videos-update',
@@ -156,7 +157,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
this.loadingBar.useRef().complete()
this.isUpdatingVideo = false
this.notifier.error(err.message)
- console.error(err)
+ logger.error(err)
}
})
}
diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts
index 8e556c58f..28edcfdcb 100644
--- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts
+++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts
@@ -5,6 +5,7 @@ import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifie
import { HooksService } from '@app/core/plugins/hooks.service'
import { Syndication, VideoDetails } from '@app/shared/shared-main'
import { VideoComment, VideoCommentService, VideoCommentThreadTree } from '@app/shared/shared-video-comment'
+import { PeerTubeProblemDocument, ServerErrorCode } from '@shared/models'
@Component({
selector: 'my-video-comments',
@@ -104,7 +105,14 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
}
},
- error: err => this.notifier.error(err.message)
+ error: err => {
+ // We may try to fetch highlighted thread of another video, skip the error if it is the case
+ // We'll retry the request on video Input() change
+ const errorBody = err.body as PeerTubeProblemDocument
+ if (highlightThread && errorBody?.code === ServerErrorCode.COMMENT_NOT_ASSOCIATED_TO_VIDEO) return
+
+ this.notifier.error(err.message)
+ }
})
}
@@ -130,6 +138,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
this.totalNotDeletedComments = res.totalNotDeletedComments
this.onDataSubject.next(res.data)
+
this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination })
},
@@ -253,6 +262,10 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
this.syndicationItems = this.videoCommentService.getVideoCommentsFeeds(this.video)
this.loadMoreThreads()
+
+ if (this.activatedRoute.params['threadId']) {
+ this.processHighlightedThread(+this.activatedRoute.params['threadId'])
+ }
}
}
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 @@
import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'
import { MarkdownService, Notifier } from '@app/core'
import { VideoDetails, VideoService } from '@app/shared/shared-main'
+import { logger } from '@root-helpers/logger'
@Component({
selector: 'my-video-description',
@@ -75,7 +76,7 @@ export class VideoDescriptionComponent implements OnChanges {
private updateVideoDescription (description: string) {
this.video.description = description
this.setVideoDescriptionHTML()
- .catch(err => console.error(err))
+ .catch(err => logger.error(err))
}
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..8d9c08ab3 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
import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
import { LiveVideoService } from '@app/shared/shared-video-live'
import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
+import { logger } from '@root-helpers/logger'
import { isP2PEnabled } from '@root-helpers/video'
import { timeToInt } from '@shared/core-utils'
import {
@@ -225,7 +226,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
: parseInt(positionParam + '', 10)
if (isNaN(this.playlistPosition)) {
- console.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`)
+ logger.error(`playlistPosition query param '${positionParam}' was parsed as NaN, defaulting to 1.`)
this.playlistPosition = 1
}
@@ -241,6 +242,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
if (this.player) this.player.pause()
+ this.video = undefined
+
const videoObs = this.hooks.wrapObsFun(
this.videoService.getVideo.bind(this.videoService),
{ videoId },
@@ -378,7 +381,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
}
this.buildPlayer(urlOptions, loggedInOrAnonymousUser)
- .catch(err => console.error('Cannot build the player', err))
+ .catch(err => logger.error('Cannot build the player', err))
this.setOpenGraphTags()
@@ -550,7 +553,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.player.dispose()
this.player = undefined
} catch (err) {
- console.error('Cannot dispose player.', err)
+ logger.error('Cannot dispose player.', err)
}
}
@@ -717,7 +720,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
private handleLiveStateChange (newState: VideoState) {
if (newState !== VideoState.PUBLISHED) return
- console.log('Loading video after live update.')
+ logger.info('Loading video after live update.')
const videoUUID = this.video.uuid
@@ -728,11 +731,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
private handleLiveViewsChange (newViewers: number) {
if (!this.video) {
- console.error('Cannot update video live views because video is no defined.')
+ logger.error('Cannot update video live views because video is no defined.')
return
}
- console.log('Updating live views.')
+ logger.info('Updating live views.')
this.video.viewers = newViewers
}
diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html
index 629c04e6b..6a833b039 100644
--- a/client/src/app/app.component.html
+++ b/client/src/app/app.component.html
@@ -3,7 +3,7 @@
- |