diff options
-rw-r--r-- | CHANGELOG.md | 24 | ||||
-rw-r--r-- | client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss | 2 | ||||
-rw-r--r-- | client/src/app/shared/shared-video-miniature/videos-selection.component.scss | 1 | ||||
-rw-r--r-- | client/src/standalone/videos/embed.html | 7 | ||||
-rw-r--r-- | server/initializers/constants.ts | 2 | ||||
-rw-r--r-- | server/lib/views/shared/video-viewer-counters.ts | 2 | ||||
-rw-r--r-- | server/models/account/account-blocklist.ts | 14 | ||||
-rw-r--r-- | server/models/user/user.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-comment.ts | 4 | ||||
-rw-r--r-- | server/models/video/video-playlist.ts | 4 | ||||
-rw-r--r-- | server/tests/api/moderation/blocklist.ts | 28 | ||||
-rw-r--r-- | server/tests/api/server/stats.ts | 4 | ||||
-rw-r--r-- | shared/server-commands/users/blocklist-command.ts | 9 |
13 files changed, 93 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c070d44f..e9236e46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md | |||
@@ -1,5 +1,29 @@ | |||
1 | # Changelog | 1 | # Changelog |
2 | 2 | ||
3 | ## v4.2.1 | ||
4 | |||
5 | ### IMPORTANT NOTES | ||
6 | |||
7 | * If you upgrade from PeerTube **< 4.2.0**, please follow 4.2.0 IMPORTANT NOTES | ||
8 | |||
9 | ### Bug fixes | ||
10 | |||
11 | * Fix live ending job that breaks new live session | ||
12 | * Fix search filters counter | ||
13 | * Fix upload banner icon margin | ||
14 | * Fix button icon margin | ||
15 | * Fix my import expander icon that should only be displayed on import error | ||
16 | * Fix select components styling inconsistency | ||
17 | * Increase max watch section to avoid too much warnings in server | ||
18 | * Optimize broadcast job creation | ||
19 | * Optimize `View` activities delivery using a dedicated broadcast job queue that can be run in parallel | ||
20 | * Fix video selection buttons placement | ||
21 | * Fix searching into account blocklist | ||
22 | * Fix incorrect instance stats | ||
23 | * Fix broken player on ICE error | ||
24 | * Relax views federation | ||
25 | |||
26 | |||
3 | ## v4.2.0 | 27 | ## v4.2.0 |
4 | 28 | ||
5 | ### IMPORTANT NOTES | 29 | ### IMPORTANT NOTES |
diff --git a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss index b8e6136fb..fd8cd7ffc 100644 --- a/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss +++ b/client/src/app/shared/shared-actor-image-edit/actor-avatar-edit.component.scss | |||
@@ -15,6 +15,8 @@ my-actor-avatar { | |||
15 | } | 15 | } |
16 | 16 | ||
17 | .actor-info-display-name { | 17 | .actor-info-display-name { |
18 | @include peertube-word-wrap; | ||
19 | |||
18 | font-size: 20px; | 20 | font-size: 20px; |
19 | font-weight: $font-bold; | 21 | font-weight: $font-bold; |
20 | 22 | ||
diff --git a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss index 3bb375980..1827f25ef 100644 --- a/client/src/app/shared/shared-video-miniature/videos-selection.component.scss +++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | .action-selection-mode-child { | 10 | .action-selection-mode-child { |
11 | position: fixed; | 11 | position: fixed; |
12 | display: flex; | ||
12 | 13 | ||
13 | .action-button { | 14 | .action-button { |
14 | @include margin-left(55px); | 15 | @include margin-left(55px); |
diff --git a/client/src/standalone/videos/embed.html b/client/src/standalone/videos/embed.html index f30dda96b..eab6f81a6 100644 --- a/client/src/standalone/videos/embed.html +++ b/client/src/standalone/videos/embed.html | |||
@@ -67,7 +67,12 @@ | |||
67 | if (placeholderPreview) placeholderPreview.style.display = 'none' | 67 | if (placeholderPreview) placeholderPreview.style.display = 'none' |
68 | } | 68 | } |
69 | 69 | ||
70 | window.onerror = function () { | 70 | window.onerror = function (msg) { |
71 | if (typeof msg === 'string' && msg.toLowerCase().includes(' ice ')) { | ||
72 | console.warn(msg) | ||
73 | return | ||
74 | } | ||
75 | |||
71 | window.displayIncompatibleBrowser() | 76 | window.displayIncompatibleBrowser() |
72 | } | 77 | } |
73 | 78 | ||
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 52007d212..f54ce9506 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -370,7 +370,7 @@ const CONSTRAINTS_FIELDS = { | |||
370 | 370 | ||
371 | const VIEW_LIFETIME = { | 371 | const VIEW_LIFETIME = { |
372 | VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION, | 372 | VIEW: CONFIG.VIEWS.VIDEOS.IP_VIEW_EXPIRATION, |
373 | VIEWER_COUNTER: 60000 * 1, // 1 minute | 373 | VIEWER_COUNTER: 60000 * 2, // 2 minutes |
374 | VIEWER_STATS: 60000 * 60 // 1 hour | 374 | VIEWER_STATS: 60000 * 60 // 1 hour |
375 | } | 375 | } |
376 | 376 | ||
diff --git a/server/lib/views/shared/video-viewer-counters.ts b/server/lib/views/shared/video-viewer-counters.ts index 587621320..cf3fa5882 100644 --- a/server/lib/views/shared/video-viewer-counters.ts +++ b/server/lib/views/shared/video-viewer-counters.ts | |||
@@ -165,7 +165,7 @@ export class VideoViewerCounters { | |||
165 | private async federateViewerIfNeeded (video: MVideoImmutable, viewer: Viewer) { | 165 | private async federateViewerIfNeeded (video: MVideoImmutable, viewer: Viewer) { |
166 | // Federate the viewer if it's been a "long" time we did not | 166 | // Federate the viewer if it's been a "long" time we did not |
167 | const now = new Date().getTime() | 167 | const now = new Date().getTime() |
168 | const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER / 2) | 168 | const federationLimit = now - (VIEW_LIFETIME.VIEWER_COUNTER * 0.75) |
169 | 169 | ||
170 | if (viewer.lastFederation && viewer.lastFederation > federationLimit) return | 170 | if (viewer.lastFederation && viewer.lastFederation > federationLimit) return |
171 | 171 | ||
diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index a7b8db076..377249b38 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts | |||
@@ -132,6 +132,20 @@ export class AccountBlocklistModel extends Model<Partial<AttributesOnly<AccountB | |||
132 | as: 'BlockedAccount' | 132 | as: 'BlockedAccount' |
133 | } | 133 | } |
134 | ] | 134 | ] |
135 | } else if (search) { // We need some joins when counting with search | ||
136 | query.include = [ | ||
137 | { | ||
138 | model: AccountModel.unscoped(), | ||
139 | required: true, | ||
140 | as: 'BlockedAccount', | ||
141 | include: [ | ||
142 | { | ||
143 | model: ActorModel.unscoped(), | ||
144 | required: true | ||
145 | } | ||
146 | ] | ||
147 | } | ||
148 | ] | ||
135 | } | 149 | } |
136 | 150 | ||
137 | return query | 151 | return query |
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 20c2222a7..a25551ecd 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -819,10 +819,10 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> { | |||
819 | } | 819 | } |
820 | } | 820 | } |
821 | 821 | ||
822 | return UserModel.count(query) | 822 | return UserModel.unscoped().count(query) |
823 | } | 823 | } |
824 | 824 | ||
825 | const totalUsers = await UserModel.count() | 825 | const totalUsers = await UserModel.unscoped().count() |
826 | const totalDailyActiveUsers = await getActiveUsers(1) | 826 | const totalDailyActiveUsers = await getActiveUsers(1) |
827 | const totalWeeklyActiveUsers = await getActiveUsers(7) | 827 | const totalWeeklyActiveUsers = await getActiveUsers(7) |
828 | const totalMonthlyActiveUsers = await getActiveUsers(30) | 828 | const totalMonthlyActiveUsers = await getActiveUsers(30) |
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index 2d60c6a30..1d3178164 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts | |||
@@ -683,11 +683,11 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment | |||
683 | const totalLocalVideoComments = await VideoCommentModel.count({ | 683 | const totalLocalVideoComments = await VideoCommentModel.count({ |
684 | include: [ | 684 | include: [ |
685 | { | 685 | { |
686 | model: AccountModel, | 686 | model: AccountModel.unscoped(), |
687 | required: true, | 687 | required: true, |
688 | include: [ | 688 | include: [ |
689 | { | 689 | { |
690 | model: ActorModel, | 690 | model: ActorModel.unscoped(), |
691 | required: true, | 691 | required: true, |
692 | where: { | 692 | where: { |
693 | serverId: null | 693 | serverId: null |
diff --git a/server/models/video/video-playlist.ts b/server/models/video/video-playlist.ts index 8fb3d5f15..00cca0549 100644 --- a/server/models/video/video-playlist.ts +++ b/server/models/video/video-playlist.ts | |||
@@ -617,11 +617,11 @@ export class VideoPlaylistModel extends Model<Partial<AttributesOnly<VideoPlayli | |||
617 | const totalLocalPlaylists = await VideoPlaylistModel.count({ | 617 | const totalLocalPlaylists = await VideoPlaylistModel.count({ |
618 | include: [ | 618 | include: [ |
619 | { | 619 | { |
620 | model: AccountModel, | 620 | model: AccountModel.unscoped(), |
621 | required: true, | 621 | required: true, |
622 | include: [ | 622 | include: [ |
623 | { | 623 | { |
624 | model: ActorModel, | 624 | model: ActorModel.unscoped(), |
625 | required: true, | 625 | required: true, |
626 | where: { | 626 | where: { |
627 | serverId: null | 627 | serverId: null |
diff --git a/server/tests/api/moderation/blocklist.ts b/server/tests/api/moderation/blocklist.ts index e1344a245..a5a92317d 100644 --- a/server/tests/api/moderation/blocklist.ts +++ b/server/tests/api/moderation/blocklist.ts | |||
@@ -256,6 +256,13 @@ describe('Test blocklist', function () { | |||
256 | } | 256 | } |
257 | }) | 257 | }) |
258 | 258 | ||
259 | it('Should search blocked accounts', async function () { | ||
260 | const body = await command.listMyAccountBlocklist({ start: 0, count: 10, search: 'user2' }) | ||
261 | expect(body.total).to.equal(1) | ||
262 | |||
263 | expect(body.data[0].blockedAccount.name).to.equal('user2') | ||
264 | }) | ||
265 | |||
259 | it('Should get blocked status', async function () { | 266 | it('Should get blocked status', async function () { |
260 | const remoteHandle = 'user2@' + servers[1].host | 267 | const remoteHandle = 'user2@' + servers[1].host |
261 | const localHandle = 'user1@' + servers[0].host | 268 | const localHandle = 'user1@' + servers[0].host |
@@ -475,6 +482,13 @@ describe('Test blocklist', function () { | |||
475 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) | 482 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) |
476 | }) | 483 | }) |
477 | 484 | ||
485 | it('Should search blocked servers', async function () { | ||
486 | const body = await command.listMyServerBlocklist({ start: 0, count: 10, search: servers[1].host }) | ||
487 | expect(body.total).to.equal(1) | ||
488 | |||
489 | expect(body.data[0].blockedServer.host).to.equal(servers[1].host) | ||
490 | }) | ||
491 | |||
478 | it('Should get blocklist status', async function () { | 492 | it('Should get blocklist status', async function () { |
479 | const blockedServer = servers[1].host | 493 | const blockedServer = servers[1].host |
480 | const notBlockedServer = 'example.com' | 494 | const notBlockedServer = 'example.com' |
@@ -645,6 +659,13 @@ describe('Test blocklist', function () { | |||
645 | } | 659 | } |
646 | }) | 660 | }) |
647 | 661 | ||
662 | it('Should search blocked accounts', async function () { | ||
663 | const body = await command.listServerAccountBlocklist({ start: 0, count: 10, search: 'user2' }) | ||
664 | expect(body.total).to.equal(1) | ||
665 | |||
666 | expect(body.data[0].blockedAccount.name).to.equal('user2') | ||
667 | }) | ||
668 | |||
648 | it('Should get blocked status', async function () { | 669 | it('Should get blocked status', async function () { |
649 | const remoteHandle = 'user2@' + servers[1].host | 670 | const remoteHandle = 'user2@' + servers[1].host |
650 | const localHandle = 'user1@' + servers[0].host | 671 | const localHandle = 'user1@' + servers[0].host |
@@ -805,6 +826,13 @@ describe('Test blocklist', function () { | |||
805 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) | 826 | expect(block.blockedServer.host).to.equal('localhost:' + servers[1].port) |
806 | }) | 827 | }) |
807 | 828 | ||
829 | it('Should search blocked servers', async function () { | ||
830 | const body = await command.listServerServerBlocklist({ start: 0, count: 10, search: servers[1].host }) | ||
831 | expect(body.total).to.equal(1) | ||
832 | |||
833 | expect(body.data[0].blockedServer.host).to.equal(servers[1].host) | ||
834 | }) | ||
835 | |||
808 | it('Should get blocklist status', async function () { | 836 | it('Should get blocklist status', async function () { |
809 | const blockedServer = servers[1].host | 837 | const blockedServer = servers[1].host |
810 | const notBlockedServer = 'example.com' | 838 | const notBlockedServer = 'example.com' |
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index a9ae236fb..6654eaaee 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts | |||
@@ -10,6 +10,8 @@ import { | |||
10 | doubleFollow, | 10 | doubleFollow, |
11 | PeerTubeServer, | 11 | PeerTubeServer, |
12 | setAccessTokensToServers, | 12 | setAccessTokensToServers, |
13 | setDefaultAccountAvatar, | ||
14 | setDefaultChannelAvatar, | ||
13 | waitJobs | 15 | waitJobs |
14 | } from '@shared/server-commands' | 16 | } from '@shared/server-commands' |
15 | 17 | ||
@@ -29,6 +31,8 @@ describe('Test stats (excluding redundancy)', function () { | |||
29 | servers = await createMultipleServers(3) | 31 | servers = await createMultipleServers(3) |
30 | 32 | ||
31 | await setAccessTokensToServers(servers) | 33 | await setAccessTokensToServers(servers) |
34 | await setDefaultChannelAvatar(servers) | ||
35 | await setDefaultAccountAvatar(servers) | ||
32 | 36 | ||
33 | await doubleFollow(servers[0], servers[1]) | 37 | await doubleFollow(servers[0], servers[1]) |
34 | 38 | ||
diff --git a/shared/server-commands/users/blocklist-command.ts b/shared/server-commands/users/blocklist-command.ts index 2e7ed074d..862d8945e 100644 --- a/shared/server-commands/users/blocklist-command.ts +++ b/shared/server-commands/users/blocklist-command.ts | |||
@@ -6,7 +6,10 @@ import { AbstractCommand, OverrideCommandOptions } from '../shared' | |||
6 | type ListBlocklistOptions = OverrideCommandOptions & { | 6 | type ListBlocklistOptions = OverrideCommandOptions & { |
7 | start: number | 7 | start: number |
8 | count: number | 8 | count: number |
9 | sort: string // default -createdAt | 9 | |
10 | sort?: string // default -createdAt | ||
11 | |||
12 | search?: string | ||
10 | } | 13 | } |
11 | 14 | ||
12 | export class BlocklistCommand extends AbstractCommand { | 15 | export class BlocklistCommand extends AbstractCommand { |
@@ -147,13 +150,13 @@ export class BlocklistCommand extends AbstractCommand { | |||
147 | } | 150 | } |
148 | 151 | ||
149 | private listBlocklist <T> (options: ListBlocklistOptions, path: string) { | 152 | private listBlocklist <T> (options: ListBlocklistOptions, path: string) { |
150 | const { start, count, sort = '-createdAt' } = options | 153 | const { start, count, search, sort = '-createdAt' } = options |
151 | 154 | ||
152 | return this.getRequestBody<ResultList<T>>({ | 155 | return this.getRequestBody<ResultList<T>>({ |
153 | ...options, | 156 | ...options, |
154 | 157 | ||
155 | path, | 158 | path, |
156 | query: { start, count, sort }, | 159 | query: { start, count, sort, search }, |
157 | implicitToken: true, | 160 | implicitToken: true, |
158 | defaultExpectedStatus: HttpStatusCode.OK_200 | 161 | defaultExpectedStatus: HttpStatusCode.OK_200 |
159 | }) | 162 | }) |