1
0
Fork 0
-----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEExEqtY4NnkSypPt1XWDphLYkBWb4FAmYvTgIACgkQWDphLYkB
 Wb6g6wgAljLbcIKveQgJGWcwlwLefkVDd6up+kBv+0pCFOkdIihV6G7SQRdUujS3
 U3/mjOB+hgtIbv9Bu9ahY30831px7gm0/5d7hntkCqoM805kkaf2U2y62oFY+SNq
 VeiUu0L3tnHdaxIdgsKq+2sX/dZKA0bai+IjcjJaEXc8ZVwiNVU+qXLzEk3xVECM
 o2LtJp10q8qIA+YjIc9niMfz94a/iwUaix9VY3uG3o8xNeBVVM9PcZDRywFc7NJI
 Ve/OeEYQ4ydjWYV/RaNZQAVc9zFJObrFwOjWwdYshSz8NbwM8GaxwU36SQUpvfg5
 JEF2jmGRA6FzTaaOeA8gwR8O6rq3FA==
 =PULO
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEEGCBYi9NGimfngx9dVTwOu+tdXwgFAmYxd7MZHGtvdG92YWxl
 eGFyaWFuQGdtYWlsLmNvbQAKCRBVPA67611fCOHjD/44LHXuzlMJBFvW7CLxmao8
 ryUuO/BPd2eBHzhZ3b+qJzv9A1bIVqh4ocgRtn8Kukll+z1JWaJi9Tc79ReoOmOK
 kI9kEM8YTKWwoyun0akaEn+K9xm13XeqJdWLmaIsHhChuj5fvAnfaXHuFOb13LCG
 wN03RePZfXZMX9OziuXKbCN29f4zthzpObompzw2Lz7qOfVv5FFIJPE2v/vP8Mnq
 09KTVnb2hHluy1pAjpDPRNS9yzIqXXrifGjxKF8PSnoUqzlz/KN4/wfzD1PBXa3m
 io5b5w/yPRvRZd8u6Co5MMoFZvV2veYEEuIQIklRuw0Ag5wIr4unCfoEo/dMcwBZ
 AWRizDxo6C95Y2mbCnXfw7Sx8oDWWH623qUcIJPW0llE/K0LyVvwM6LGdszcFUjD
 iHAWARg01p8xX/TUz4baAP5Rt0i1v4lUhAg/kR+x2kcVuxcMj6/b+jhZElF2KTPt
 LcQwhTovvz7WtspP4hmRY9i3DGydr/4LSl8+n6hHDbvs4gznsQwcD2sSJoN1cSzR
 XrAhMN2HyKw/ok4Sqen01oPJZL5XdzJVFFWLfAZZ/A1J9uk9UHAzBsyNXWfwK9KN
 /p9u2JN/uXgvmtj4uc8ECaFwyuK05NFS1Ax5PT649Ugein/shHIQCchVArVahtm8
 xAt7J4WEPTB+KfUi+vK6yQ==
 =LCjE
 -----END PGP SIGNATURE-----

Merge tag 'v6.1.0' into changes

v6.1.0
This commit is contained in:
Alex Kotov 2024-05-01 02:58:57 +04:00
commit 29ac4fc084
118 changed files with 19921 additions and 9930 deletions

View File

@ -1,6 +1,6 @@
# Changelog
## v6.1.0-rc.1
## v6.1.0
### IMPORTANT NOTES
@ -11,6 +11,11 @@
* Views use a *Session ID* generated by the web browser instead of using the request IP (former behavior can be restored in YAML config)
* The goal of this change is to get closer to how other video platforms like Mux, Vimeo, or Instagram work
### SECURITY
* Compact ActivityPub JSON-LD objects before using them to prevent incorrect access control @tesaguri
* Protect ActivityPub information related to private/internal/blocked videos
### Admin config (non-exhaustive)
* **Breaking changes**:
@ -127,6 +132,9 @@
* Fix view endpoint crash on geoip update failure
* Fix setting video subtitle from URL query
* Fix selecting "Display all languages/categories/licences" in videos search resulting in an empty search
* Fix followers/following counter of local ActivityPub actors
* Fix notification button link on mobile
* Fix player subtitles on iOS
## v6.0.4

View File

@ -1,6 +1,6 @@
{
"name": "peertube-client",
"version": "6.1.0-rc.1",
"version": "6.1.0",
"private": true,
"license": "AGPL-3.0",
"author": {

View File

@ -216,7 +216,10 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
getFilesSize (video: Video) {
let total = getAllFiles(video).reduce((p, f) => p += f.size, 0)
total += video.videoSource?.size || 0
if (video.videoSource?.fileDownloadUrl) {
total += video.videoSource.size || 0
}
return total
}

View File

@ -309,7 +309,7 @@ export class VideoStatsComponent implements OnInit {
{
label: $localize`Views`,
value: this.numberFormatter.transform(this.video.views),
help: $localize`A view means that someone watched the video for at least 30 seconds`
help: $localize`A view means that someone watched the video for several seconds (10 seconds by default)`
},
{
label: $localize`Likes`,

View File

@ -1,21 +1,29 @@
import { Subject, Subscription } from 'rxjs'
import { filter } from 'rxjs/operators'
import { Component, EventEmitter, Output, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { NavigationEnd, Router } from '@angular/router'
import { Notifier, PeerTubeSocket, ScreenService } from '@app/core'
import { NgbPopover, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'
import { UserNotificationsComponent } from '@app/shared/standalone-notifications/user-notifications.component'
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
import { CommonModule } from '@angular/common'
import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { NavigationEnd, Router, RouterLink, RouterLinkActive } from '@angular/router'
import { Notifier, PeerTubeSocket, ScreenService } from '@app/core'
import { GlobalIconComponent } from '@app/shared/shared-icons/global-icon.component'
import { LoaderComponent } from '@app/shared/shared-main/loaders/loader.component'
import { UserNotificationService } from '@app/shared/shared-main/users/user-notification.service'
import { UserNotificationsComponent } from '@app/shared/standalone-notifications/user-notifications.component'
import { NgbPopover, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'
import { Subject, Subscription } from 'rxjs'
import { filter } from 'rxjs/operators'
@Component({
selector: 'my-notification',
templateUrl: './notification.component.html',
styleUrls: [ './notification.component.scss' ],
standalone: true,
imports: [ CommonModule, NgbPopoverModule, UserNotificationsComponent, GlobalIconComponent, LoaderComponent ]
imports: [
CommonModule,
NgbPopoverModule,
UserNotificationsComponent,
GlobalIconComponent,
LoaderComponent,
RouterLink,
RouterLinkActive
]
})
export class NotificationComponent implements OnInit, OnDestroy {
@ViewChild('popover', { static: true }) popover: NgbPopover

View File

@ -361,7 +361,10 @@ export class PeerTubePlayer {
getVideojsOptions (): videojs.PlayerOptions {
const html5 = {
preloadTextTracks: false
preloadTextTracks: false,
// Prevent a bug on iOS where the text tracks added by peertube plugin are removed on play
// See https://github.com/Chocobozzz/PeerTube/issues/6351
nativeTextTracks: false
}
const plugins: VideoJSPluginOptions = {

View File

@ -83,7 +83,7 @@
}
</script>
<my-app role="main">
<my-app>
</my-app>
</body>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template" target-language="ro">
<body>
@ -106,33 +106,33 @@
<context context-type="linenumber">5</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.pagination.first-aria" datatype="html">
<trans-unit id="ngb.pagination.first-aria" datatype="html" xml:space="preserve">
<source>First</source>
<target/>
<target state="translated">Primul</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/pagination/pagination.d.ts</context>
<context context-type="linenumber">14</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.pagination.previous-aria" datatype="html">
<trans-unit id="ngb.pagination.previous-aria" datatype="html" xml:space="preserve">
<source>Previous</source>
<target/>
<target state="translated">Anterior</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/pagination/pagination.d.ts</context>
<context context-type="linenumber">24</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.pagination.next-aria" datatype="html">
<trans-unit id="ngb.pagination.next-aria" datatype="html" xml:space="preserve">
<source>Next</source>
<target/>
<target state="translated">Următorul</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/pagination/pagination.d.ts</context>
<context context-type="linenumber">44</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.pagination.last-aria" datatype="html">
<trans-unit id="ngb.pagination.last-aria" datatype="html" xml:space="preserve">
<source>Last</source>
<target/>
<target state="translated">Ultimul</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/pagination/pagination.d.ts</context>
<context context-type="linenumber">53</context>
@ -146,9 +146,9 @@
<context context-type="linenumber">7</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.increment-hours" datatype="html">
<trans-unit id="ngb.timepicker.increment-hours" datatype="html" xml:space="preserve">
<source>Increment hours</source>
<target/>
<target state="translated">Adaugă ore</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">9</context>
@ -170,17 +170,17 @@
<context context-type="linenumber">15</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.decrement-hours" datatype="html">
<trans-unit id="ngb.timepicker.decrement-hours" datatype="html" xml:space="preserve">
<source>Decrement hours</source>
<target/>
<target state="translated">Scade ore</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">23</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.increment-minutes" datatype="html">
<trans-unit id="ngb.timepicker.increment-minutes" datatype="html" xml:space="preserve">
<source>Increment minutes</source>
<target/>
<target state="translated">Adaugă minute</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">32</context>
@ -202,17 +202,17 @@
<context context-type="linenumber">37</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.decrement-minutes" datatype="html">
<trans-unit id="ngb.timepicker.decrement-minutes" datatype="html" xml:space="preserve">
<source>Decrement minutes</source>
<target/>
<target state="translated">Scade minute</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">45</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.increment-seconds" datatype="html">
<trans-unit id="ngb.timepicker.increment-seconds" datatype="html" xml:space="preserve">
<source>Increment seconds</source>
<target/>
<target state="translated">Adaugă secunde</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">54</context>
@ -234,9 +234,9 @@
<context context-type="linenumber">59</context>
</context-group>
</trans-unit>
<trans-unit id="ngb.timepicker.decrement-seconds" datatype="html">
<trans-unit id="ngb.timepicker.decrement-seconds" datatype="html" xml:space="preserve">
<source>Decrement seconds</source>
<target/>
<target state="translated">Scade secunde</target>
<context-group purpose="location">
<context context-type="sourcefile">node_modules/@ng-bootstrap/ng-bootstrap/timepicker/timepicker.d.ts</context>
<context context-type="linenumber">67</context>
@ -298,17 +298,17 @@
<context context-type="linenumber">32</context>
</context-group>
</trans-unit>
<trans-unit id="066903c4bc7d397c799979d64ce8c450792eb664" datatype="html">
<trans-unit id="066903c4bc7d397c799979d64ce8c450792eb664" datatype="html" xml:space="preserve">
<source>Your video <x id="START_LINK" ctype="x-a" equiv-text="&lt;a&gt;"/><x id="INTERPOLATION" equiv-text="{{ notification.videoBlacklist.video.name }}"/><x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> has been blacklisted </source>
<target/>
<target state="translated">Videoul tău  <x id="START_LINK" ctype="x-a" equiv-text="&lt;a&gt;"/><x id="INTERPOLATION" equiv-text="{{ notification.videoBlacklist.video.name }}"/><x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> a fost blocat. </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/users/user-notifications.component.html</context>
<context context-type="linenumber">40</context>
</context-group>
</trans-unit>
<trans-unit id="b5e2152dd5b4222093fcec9c8289f12308a598e7" datatype="html">
<trans-unit id="b5e2152dd5b4222093fcec9c8289f12308a598e7" datatype="html" xml:space="preserve">
<source><x id="START_LINK" ctype="x-a" equiv-text="&lt;a&gt;"/>A new video abuse<x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> has been created on video <x id="START_LINK_1" ctype="x-a" equiv-text="&lt;a&gt;"/><x id="INTERPOLATION" equiv-text="{{ notification.videoAbuse.video.name }}"/><x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> </source>
<target/>
<target state="translated"><x id="START_LINK" ctype="x-a" equiv-text="&lt;a&gt;"/>A new video abuse<x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> has been created on video <x id="START_LINK_1" ctype="x-a" equiv-text="&lt;a&gt;"/><x id="INTERPOLATION" equiv-text="{{ notification.videoAbuse.video.name }}"/><x id="CLOSE_LINK" ctype="x-a" equiv-text="&lt;/a&gt;"/> </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/users/user-notifications.component.html</context>
<context context-type="linenumber">48</context>
@ -438,9 +438,9 @@
<context context-type="linenumber">42</context>
</context-group>
</trans-unit>
<trans-unit id="1394835141143590910" datatype="html">
<trans-unit id="1394835141143590910" datatype="html" xml:space="preserve">
<source>Start at</source>
<target/>
<target state="translated">Începe la</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video-playlist/video-add-to-playlist.component.html</context>
<context context-type="linenumber">17</context>
@ -454,9 +454,9 @@
<context context-type="linenumber">75</context>
</context-group>
</trans-unit>
<trans-unit id="5964984095397511808" datatype="html">
<trans-unit id="5964984095397511808" datatype="html" xml:space="preserve">
<source>Stop at</source>
<target/>
<target state="translated">Oprește la</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video-playlist/video-add-to-playlist.component.html</context>
<context context-type="linenumber">31</context>
@ -766,17 +766,17 @@
<context context-type="linenumber">26</context>
</context-group>
</trans-unit>
<trans-unit id="8558962068274430520" datatype="html">
<trans-unit id="8558962068274430520" datatype="html" xml:space="preserve">
<source>Unfederate the video</source>
<target/>
<target state="translated">Decuplați videoclipul</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video/modals/video-blacklist.component.html</context>
<context context-type="linenumber">23</context>
</context-group>
</trans-unit>
<trans-unit id="7539427273132299890" datatype="html">
<trans-unit id="7539427273132299890" datatype="html" xml:space="preserve">
<source>Unlisted</source>
<target/>
<target state="translated">Nelistat</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video/video-miniature.component.html</context>
<context context-type="linenumber">6</context>
@ -802,9 +802,9 @@
<context context-type="linenumber">7</context>
</context-group>
</trans-unit>
<trans-unit id="7688104409544625220" datatype="html">
<trans-unit id="7688104409544625220" datatype="html" xml:space="preserve">
<source>{VAR_PLURAL, plural, =1 {1 view} other {<x id="INTERPOLATION" equiv-text="{{ video.views | myNumberFormatter }}"/> views} }</source>
<target/>
<target state="translated">{VAR_PLURAL, plural, =1 {1 view} other {<x id="INTERPOLATION" equiv-text="{{ video.views | myNumberFormatter }}"/> views} }</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video/video-miniature.component.html</context>
<context context-type="linenumber">23</context>
@ -818,9 +818,9 @@
<context context-type="linenumber">41</context>
</context-group>
</trans-unit>
<trans-unit id="3514509630940272440" datatype="html">
<trans-unit id="3514509630940272440" datatype="html" xml:space="preserve">
<source>Sensitive</source>
<target/>
<target state="translated">Sensitiv</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video/video-miniature.component.html</context>
<context context-type="linenumber">45</context>
@ -874,9 +874,9 @@
<context context-type="linenumber">100</context>
</context-group>
</trans-unit>
<trans-unit id="5263519165976128456" datatype="html">
<trans-unit id="5263519165976128456" datatype="html" xml:space="preserve">
<source>Edit starts/stops at</source>
<target/>
<target state="translated">Editarea începe/oprește la</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/video-playlist/video-playlist-element-miniature.component.html</context>
<context context-type="linenumber">50</context>
@ -1182,9 +1182,9 @@
<context context-type="linenumber">17</context>
</context-group>
</trans-unit>
<trans-unit id="c590f63488a5179f20a46930cf5e673f8136673d" datatype="html">
<trans-unit id="c590f63488a5179f20a46930cf5e673f8136673d" datatype="html" xml:space="preserve">
<source>You can interact with this via any ActivityPub-capable fediverse instance.<x id="LINE_BREAK" ctype="lb" equiv-text="&lt;br/&gt;"/><x id="LINE_BREAK" ctype="lb" equiv-text="&lt;br/&gt;"/> For instance with Mastodon or Pleroma you can type the current URL in the search box and interact with it there. </source>
<target/>
<target state="translated">Poți interacționa cu acesta prin orice ActivityPub-compatibil instanță fediverse.<x id="LINE_BREAK" ctype="lb" equiv-text="&lt;br/&gt;"/><x id="LINE_BREAK" ctype="lb" equiv-text="&lt;br/&gt;"/>De exemplu cu Mastodon sau Pleroma poți scrie URL-ul curent în cutia de căutare și interacționa cu el acolo. </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/user-subscription/remote-subscribe.component.html</context>
<context context-type="linenumber">26</context>
@ -1198,9 +1198,9 @@
<context context-type="linenumber">5</context>
</context-group>
</trans-unit>
<trans-unit id="5975923297757530070" datatype="html">
<trans-unit id="5975923297757530070" datatype="html" xml:space="preserve">
<source><x id="START_TAG_DIV" ctype="x-div" equiv-text="&lt;div&gt;"/>Default NSFW/sensitive videos policy<x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="&lt;/div&gt;"/> <x id="START_TAG_DIV_1" ctype="x-div" equiv-text="&lt;div&gt;"/>can be redefined by the users<x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="&lt;/div&gt;"/> </source>
<target/>
<target state="translated"><x id="START_TAG_DIV" ctype="x-div" equiv-text="&lt;div&gt;"/>Predefinit NSFW/sensitive videoclipuri regulamentului<x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="&lt;/div&gt;"/><x id="START_TAG_DIV_1" ctype="x-div" equiv-text="&lt;div&gt;"/>poate fii redefinit de<x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="&lt;/div&gt;"/>. </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/instance/instance-features-table.component.html</context>
<context context-type="linenumber">11</context>
@ -1266,9 +1266,9 @@
<context context-type="linenumber">139</context>
</context-group>
</trans-unit>
<trans-unit id="1502595455339510144" datatype="html">
<trans-unit id="1502595455339510144" datatype="html" xml:space="preserve">
<source>Unlimited <x id="START_TAG_NG-CONTAINER" ctype="x-ng-container" equiv-text="&lt;ng-container&gt;"/>(<x id="INTERPOLATION" equiv-text="{{ dailyUserVideoQuota | bytes: 0 }}"/> per day)<x id="CLOSE_TAG_NG-CONTAINER" ctype="x-ng-container" equiv-text="&lt;/ng-container&gt;"/> </source>
<target/>
<target state="translated">Nelimitat<x id="START_TAG_NG-CONTAINER" ctype="x-ng-container" equiv-text="&lt;ng-container&gt;"/><x id="INTERPOLATION" equiv-text="{{ dailyUserVideoQuota | bytes: 0 }}"/>pe zi<x id="CLOSE_TAG_NG-CONTAINER" ctype="x-ng-container" equiv-text="&lt;/ng-container&gt;"/>/ </target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/instance/instance-features-table.component.html</context>
<context context-type="linenumber">59</context>
@ -1306,9 +1306,9 @@
<context context-type="linenumber">77</context>
</context-group>
</trans-unit>
<trans-unit id="7683705529753923369" datatype="html">
<trans-unit id="7683705529753923369" datatype="html" xml:space="preserve">
<source>Player</source>
<target/>
<target state="translated">Jucător</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/instance/instance-features-table.component.html</context>
<context context-type="linenumber">85</context>
@ -1334,9 +1334,9 @@
<context context-type="linenumber">7</context>
</context-group>
</trans-unit>
<trans-unit id="8630916846096019339" datatype="html">
<trans-unit id="8630916846096019339" datatype="html" xml:space="preserve">
<source>Users can resolve distant content</source>
<target/>
<target state="translated">Utilizatorii pot accesa conținutul de la distanță</target>
<context-group purpose="location">
<context context-type="sourcefile">src/app/shared/instance/instance-features-table.component.html</context>
<context context-type="linenumber">100</context>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4228,11 +4228,11 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">281</context>
<context context-type="linenumber">284</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">336</context>
<context context-type="linenumber">339</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/system/runners/runner-job-list/runner-job-list.component.ts</context>
@ -6444,91 +6444,91 @@
<source>Are you sure you want to delete this <x id="PH" equiv-text="file.resolution.label"/> file?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">225</context>
<context context-type="linenumber">228</context>
</context-group>
</trans-unit>
<trans-unit id="6693349469471580292" datatype="html">
<source>Delete file</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">226</context>
<context context-type="linenumber">229</context>
</context-group>
</trans-unit>
<trans-unit id="7016764388104297354" datatype="html">
<source>File removed.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">232</context>
<context context-type="linenumber">235</context>
</context-group>
</trans-unit>
<trans-unit id="925076027211452339" datatype="html">
<source>Are you sure you want to delete the original file of this video?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">241</context>
<context context-type="linenumber">244</context>
</context-group>
</trans-unit>
<trans-unit id="3014914668468316940" datatype="html">
<source>Delete original file</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">242</context>
<context context-type="linenumber">245</context>
</context-group>
</trans-unit>
<trans-unit id="6647462936549531405" datatype="html">
<source>Original file removed.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">248</context>
<context context-type="linenumber">251</context>
</context-group>
</trans-unit>
<trans-unit id="1314383205093440631" datatype="html">
<source>Are you sure you want to delete {count, plural, =1 {this video} other {these <x id="count"/> videos}}?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">277</context>
<context context-type="linenumber">280</context>
</context-group>
</trans-unit>
<trans-unit id="5779580280418408097" datatype="html">
<source>Deleted {count, plural, =1 {1 video} other {<x id="count"/> videos}}.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">289</context>
<context context-type="linenumber">292</context>
</context-group>
</trans-unit>
<trans-unit id="9164541937317586242" datatype="html">
<source>Unblocked {count, plural, =1 {1 video} other {<x id="count"/> videos}}.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">307</context>
<context context-type="linenumber">310</context>
</context-group>
</trans-unit>
<trans-unit id="6228449077605046873" datatype="html">
<source>Are you sure you want to delete {count, plural, =1 {1 HLS streaming playlist} other {<x id="count"/> HLS streaming playlists}}?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">325</context>
<context context-type="linenumber">328</context>
</context-group>
</trans-unit>
<trans-unit id="4435640428611044716" datatype="html">
<source>Are you sure you want to delete Web Video files of {count, plural, =1 {1 video} other {<x id="count"/> videos}}?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">331</context>
<context context-type="linenumber">334</context>
</context-group>
</trans-unit>
<trans-unit id="1571742433738679426" datatype="html">
<source>Files were removed.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">342</context>
<context context-type="linenumber">345</context>
</context-group>
</trans-unit>
<trans-unit id="7054344823477412274" datatype="html">
<source>Transcoding jobs created.</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/+admin/overview/videos/video-list.component.ts</context>
<context context-type="linenumber">354</context>
<context context-type="linenumber">357</context>
</context-group>
</trans-unit>
<trans-unit id="2591467977473302125" datatype="html">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14,51 +14,51 @@
"Copy magnet URI": "Copiar lo magnet URI",
"Total downloaded: ": "Total telecargat: ",
"Total uploaded: ": "Total enviat: ",
"From servers: ": "From servers: ",
"From peers: ": "From peers: ",
"From servers: ": "Dels servidors : ",
"From peers: ": "Dels pars : ",
"Normal mode": "Normal mode",
"Stats for nerds": "Stats for nerds",
"Theater mode": "Theater mode",
"Video UUID": "Video UUID",
"Viewport / Frames": "Viewport / Frames",
"Resolution": "Resolution",
"Stats for nerds": "Estatisticas pels nerds",
"Theater mode": "Mòde cinèma",
"Video UUID": "UUID de la vidèo",
"Viewport / Frames": "Fenèstra dafichatge / Quadres",
"Resolution": "Resolucion",
"Volume": "Volume",
"Codecs": "Codecs",
"Color": "Color",
"Go back to the live": "Go back to the live",
"Connection Speed": "Connection Speed",
"Network Activity": "Network Activity",
"Total Transfered": "Total Transfered",
"Download Breakdown": "Download Breakdown",
"Go back to the live": "Tornar al dirèct",
"Connection Speed": "Velocitat de la connexion",
"Network Activity": "Activitat ret",
"Total Transfered": "Total Transferit",
"Download Breakdown": "Reparticion dels telecargaments",
"Buffer Progress": "Buffer Progress",
"Buffer State": "Buffer State",
"Live Latency": "Live Latency",
"Buffer State": "Estat memòria tampon",
"Live Latency": "Laténcia en viu",
"P2P": "P2P",
"{1} seconds": "{1} seconds",
"enabled": "enabled",
"{1} seconds": "{1} segondas",
"enabled": "activat",
"Playlist: {1}": "Playlist: {1}",
"disabled": "disabled",
"disabled": "desactivat",
" off": " desactivats",
"Player mode": "Player mode",
"Play in loop": "Play in loop",
"This live has not started yet.": "This live has not started yet.",
"This live has ended.": "This live has ended.",
"Play in loop": "Lector en bocla",
"This live has not started yet.": "Lo dirècte a pas encara començat.",
"This live has ended.": "Lo dirèct es acabat.",
"The video failed to play, will try to fast forward.": "The video failed to play, will try to fast forward.",
"{1} / {2} dropped of {3}": "{1} / {2} dropped of {3}",
" (muted)": " (muted)",
"{1} from servers · {2} from peers": "{1} from servers · {2} from peers",
"Previous video": "Previous video",
"Video page (new window)": "Video page (new window)",
" (muted)": " (mut)",
"{1} from servers · {2} from peers": "{1} dels servidors · {2} dels pars",
"Previous video": "Vidèo precedenta",
"Video page (new window)": "Pagina vidèo (fenèstra novèla)",
"Next video": "Next video",
"This video is password protected": "This video is password protected",
"You need a password to watch this video.": "You need a password to watch this video.",
"Incorrect password, please enter a correct password": "Incorrect password, please enter a correct password",
"Cancel": "Cancel",
"This video is password protected": "Un senhal protegís aquesta vidèo",
"You need a password to watch this video.": "Devètz fornir un senhal per agachar aquesta vidèo.",
"Incorrect password, please enter a correct password": "Senhal incorrècte, mercés de picar un senhal corrècte",
"Cancel": "Anullar",
"Up Next": "Up Next",
"Autoplay is suspended": "Autoplay is suspended",
"Autoplay is suspended": "La lectura automatica es suspenduda",
"{1} (from edge: {2})": "{1} (from edge: {2})",
"Disable subtitles": "Disable subtitles",
"Enable {1} subtitle": "Enable {1} subtitle",
"Disable subtitles": "Desactivar los sostítols",
"Enable {1} subtitle": "Activar {1} sostítol",
"Audio Player": "Lector àudio",
"Video Player": "Lector vidèo",
"Play": "Lectura",

View File

@ -272,5 +272,5 @@
"Traditional Chinese": "Traditional Chinese",
"Misc": "Divèrs",
"Normal mode": "Normal mode",
"Theater mode": "Theater mode"
"Theater mode": "Mòde cinèma"
}

View File

@ -1,7 +1,7 @@
{
"name": "peertube",
"description": "PeerTube, an ActivityPub-federated video streaming platform using P2P directly in your web browser.",
"version": "6.1.0-rc.1",
"version": "6.1.0",
"private": true,
"licence": "AGPL-3.0",
"engines": {
@ -237,7 +237,7 @@
"pngjs": "^7.0.0",
"proxy": "^2.1.1",
"socket.io-client": "^4.5.4",
"supertest": "^6.0.1",
"supertest": "^7.0.0",
"swagger-cli": "^4.0.2",
"tsc-watch": "^6.0.0",
"tsx": "^4.7.1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -3,12 +3,12 @@
import { expect } from 'chai'
import { FIXTURE_URLS } from '@tests/shared/fixture-urls.js'
import { sortObjectComparator } from '@peertube/peertube-core-utils'
import { UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@peertube/peertube-models'
import { HttpStatusCode, UserAdminFlag, UserRole, VideoBlacklist, VideoBlacklistType } from '@peertube/peertube-models'
import {
BlacklistCommand,
cleanupTests,
createMultipleServers,
doubleFollow, PeerTubeServer,
doubleFollow, makeActivityPubGetRequest, PeerTubeServer,
setAccessTokensToServers,
setDefaultChannelAvatar,
waitJobs
@ -298,6 +298,13 @@ describe('Test video blacklist', function () {
expect(video4Blacklisted.unfederated).to.be.true
})
it('Should not have AP comments/announces/likes/dislikes', async function () {
await makeActivityPubGetRequest(servers[0].url, `/videos/watch/${video3UUID}/comments`, HttpStatusCode.UNAUTHORIZED_401)
await makeActivityPubGetRequest(servers[0].url, `/videos/watch/${video3UUID}/announces`, HttpStatusCode.UNAUTHORIZED_401)
await makeActivityPubGetRequest(servers[0].url, `/videos/watch/${video3UUID}/likes`, HttpStatusCode.UNAUTHORIZED_401)
await makeActivityPubGetRequest(servers[0].url, `/videos/watch/${video3UUID}/dislikes`, HttpStatusCode.UNAUTHORIZED_401)
})
it('Should remove the video from blacklist and refederate the video', async function () {
await command.remove({ videoId: video4UUID })

View File

@ -165,15 +165,17 @@ describe('Test video source management', function () {
expect(data[1].videoSource.fileDownloadUrl).to.exist
expect(data[2].videoSource).to.exist
expect(data[2].videoSource.fileDownloadUrl).to.not.exist
expect(data[2].videoSource.createdAt).to.exist
expect(data[2].videoSource.fps).to.be.null
expect(data[2].videoSource.height).to.be.null
expect(data[2].videoSource.width).to.be.null
expect(data[2].videoSource.resolution.id).to.be.null
expect(data[2].videoSource.resolution.label).to.be.null
expect(data[2].videoSource.size).to.be.null
expect(data[2].videoSource.metadata).to.be.null
expect(data[2].videoSource.fps).to.to.exist
expect(data[2].videoSource.height).to.to.exist
expect(data[2].videoSource.width).to.to.exist
expect(data[2].videoSource.resolution.id).to.to.exist
expect(data[2].videoSource.resolution.label).to.to.exist
expect(data[2].videoSource.size).to.to.exist
expect(data[2].videoSource.metadata).to.to.exist
})
it('Should delete all videos and do not have original files anymore', async function () {

View File

@ -3,7 +3,7 @@
import { buildAbsoluteFixturePath } from '@peertube/peertube-node-utils'
import { signAndContextify } from '@peertube/peertube-server/core/helpers/activity-pub-utils.js'
import { isHTTPSignatureVerified, parseHTTPSignature } from '@peertube/peertube-server/core/helpers/peertube-crypto.js'
import { isJsonLDSignatureVerified, signJsonLDObject } from '@peertube/peertube-server/core/helpers/peertube-jsonld.js'
import { compactJSONLDAndCheckSignature, signJsonLDObject } from '@peertube/peertube-server/core/helpers/peertube-jsonld.js'
import { expect } from 'chai'
import { readJsonSync } from 'fs-extra/esm'
import cloneDeep from 'lodash-es/cloneDeep.js'
@ -24,6 +24,10 @@ function fakeFilter () {
return (data: any) => Promise.resolve(data)
}
function fakeExpressReq (body: any) {
return { body }
}
describe('Test activity pub helpers', function () {
describe('When checking the Linked Signature', function () {
@ -33,7 +37,7 @@ describe('Test activity pub helpers', function () {
const publicKey = readJsonSync(buildAbsoluteFixturePath('./ap-json/mastodon/public-key.json')).publicKey
const fromActor = { publicKey, url: 'http://localhost:9002/accounts/peertube' }
const result = await isJsonLDSignatureVerified(fromActor as any, body)
const result = await compactJSONLDAndCheckSignature(fromActor as any, fakeExpressReq(body))
expect(result).to.be.false
})
@ -43,7 +47,7 @@ describe('Test activity pub helpers', function () {
const publicKey = readJsonSync(buildAbsoluteFixturePath('./ap-json/mastodon/bad-public-key.json')).publicKey
const fromActor = { publicKey, url: 'http://localhost:9002/accounts/peertube' }
const result = await isJsonLDSignatureVerified(fromActor as any, body)
const result = await compactJSONLDAndCheckSignature(fromActor as any, fakeExpressReq(body))
expect(result).to.be.false
})
@ -53,7 +57,7 @@ describe('Test activity pub helpers', function () {
const publicKey = readJsonSync(buildAbsoluteFixturePath('./ap-json/mastodon/public-key.json')).publicKey
const fromActor = { publicKey, url: 'http://localhost:9002/accounts/peertube' }
const result = await isJsonLDSignatureVerified(fromActor as any, body)
const result = await compactJSONLDAndCheckSignature(fromActor as any, fakeExpressReq(body))
expect(result).to.be.true
})
@ -72,7 +76,7 @@ describe('Test activity pub helpers', function () {
})
const fromActor = { publicKey: keys.publicKey, url: 'http://localhost:9002/accounts/peertube' }
const result = await isJsonLDSignatureVerified(fromActor as any, signedBody)
const result = await compactJSONLDAndCheckSignature(fromActor as any, fakeExpressReq(signedBody))
expect(result).to.be.false
})
@ -91,7 +95,7 @@ describe('Test activity pub helpers', function () {
})
const fromActor = { publicKey: keys.publicKey, url: 'http://localhost:9002/accounts/peertube' }
const result = await isJsonLDSignatureVerified(fromActor as any, signedBody)
const result = await compactJSONLDAndCheckSignature(fromActor as any, fakeExpressReq(signedBody))
expect(result).to.be.true
})

View File

@ -120,7 +120,7 @@ activityPubClientRouter.get('/videos/watch/:id/activity',
activityPubClientRouter.get('/videos/watch/:id/announces',
executeIfActivityPub,
activityPubRateLimiter,
asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(videoAnnouncesController)
)
activityPubClientRouter.get('/videos/watch/:id/announces/:actorId',
@ -132,19 +132,19 @@ activityPubClientRouter.get('/videos/watch/:id/announces/:actorId',
activityPubClientRouter.get('/videos/watch/:id/likes',
executeIfActivityPub,
activityPubRateLimiter,
asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(videoLikesController)
)
activityPubClientRouter.get('/videos/watch/:id/dislikes',
executeIfActivityPub,
activityPubRateLimiter,
asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(videoDislikesController)
)
activityPubClientRouter.get('/videos/watch/:id/comments',
executeIfActivityPub,
activityPubRateLimiter,
asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(videoCommentsController)
)
activityPubClientRouter.get('/videos/watch/:videoId/comments/:commentId',
@ -175,7 +175,7 @@ activityPubClientRouter.get('/videos/watch/:id/chapters',
activityPubRateLimiter,
apVideoChaptersSetCacheKey,
chaptersCacheRouteMiddleware(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS),
asyncMiddleware(videosCustomGetValidator('only-video')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(videoChaptersController)
)
@ -330,7 +330,7 @@ async function videoAnnounceController (req: express.Request, res: express.Respo
}
async function videoAnnouncesController (req: express.Request, res: express.Response) {
const video = res.locals.onlyImmutableVideo
const video = res.locals.onlyVideo
if (redirectIfNotOwned(video.url, res)) return
@ -347,7 +347,7 @@ async function videoAnnouncesController (req: express.Request, res: express.Resp
}
async function videoLikesController (req: express.Request, res: express.Response) {
const video = res.locals.onlyImmutableVideo
const video = res.locals.onlyVideo
if (redirectIfNotOwned(video.url, res)) return
@ -357,7 +357,7 @@ async function videoLikesController (req: express.Request, res: express.Response
}
async function videoDislikesController (req: express.Request, res: express.Response) {
const video = res.locals.onlyImmutableVideo
const video = res.locals.onlyVideo
if (redirectIfNotOwned(video.url, res)) return
@ -367,7 +367,7 @@ async function videoDislikesController (req: express.Request, res: express.Respo
}
async function videoCommentsController (req: express.Request, res: express.Response) {
const video = res.locals.onlyImmutableVideo
const video = res.locals.onlyVideo
if (redirectIfNotOwned(video.url, res)) return

View File

@ -11,7 +11,7 @@ import { replaceChapters } from '@server/lib/video-chapters.js'
const videoChaptersRouter = express.Router()
videoChaptersRouter.get('/:id/chapters',
asyncMiddleware(videosCustomGetValidator('only-video')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
asyncMiddleware(listVideoChapters)
)

View File

@ -1,6 +1,7 @@
import express from 'express'
import { HttpStatusCode, VideoChangeOwnershipStatus, VideoState } from '@peertube/peertube-models'
import { HttpStatusCode, VideoChangeOwnershipStatus } from '@peertube/peertube-models'
import { canVideoBeFederated } from '@server/lib/activitypub/videos/federate.js'
import { MVideoFullLight } from '@server/types/models/index.js'
import express from 'express'
import { logger } from '../../../helpers/logger.js'
import { getFormattedObjects } from '../../../helpers/utils.js'
import { sequelizeTypescript } from '../../../initializers/database.js'
@ -113,7 +114,7 @@ function acceptOwnership (req: express.Request, res: express.Response) {
const targetVideoUpdated = await targetVideo.save({ transaction: t }) as MVideoFullLight
targetVideoUpdated.VideoChannel = channel
if (targetVideoUpdated.hasPrivacyForFederation() && targetVideoUpdated.state === VideoState.PUBLISHED) {
if (canVideoBeFederated(targetVideoUpdated)) {
await changeVideoChannelShare(targetVideoUpdated, oldVideoChannel, t)
await sendUpdateVideo(targetVideoUpdated, t, oldVideoChannel.Account.Actor)
}

View File

@ -68,12 +68,8 @@ async function deleteVideoLatestSourceFile (req: express.Request, res: express.R
await video.removeOriginalFile(videoSource)
videoSource.keptOriginalFilename = null
videoSource.fps = null
videoSource.resolution = null
videoSource.width = null
videoSource.height = null
videoSource.metadata = null
videoSource.size = null
videoSource.storage = null
await videoSource.save()
return res.sendStatus(HttpStatusCode.NO_CONTENT_204)

View File

@ -7,7 +7,7 @@ const tokenRouter = express.Router()
tokenRouter.post('/:id/token',
optionalAuthenticate,
asyncMiddleware(videosCustomGetValidator('only-video')),
asyncMiddleware(videosCustomGetValidator('only-video-and-blacklist')),
videoFileTokenValidator,
generateToken
)

View File

@ -1,9 +1,11 @@
import express, { UploadFiles } from 'express'
import { Transaction } from 'sequelize'
import { forceNumber } from '@peertube/peertube-core-utils'
import { HttpStatusCode, ThumbnailType, VideoPrivacy, VideoPrivacyType, VideoUpdate } from '@peertube/peertube-models'
import { exists } from '@server/helpers/custom-validators/misc.js'
import { changeVideoChannelShare } from '@server/lib/activitypub/share.js'
import { isNewVideoPrivacyForFederation, isPrivacyForFederation } from '@server/lib/activitypub/videos/federate.js'
import { updateLocalVideoMiniatureFromExisting } from '@server/lib/thumbnail.js'
import { replaceChaptersFromDescriptionIfNeeded } from '@server/lib/video-chapters.js'
import { addVideoJobsAfterUpdate } from '@server/lib/video-jobs.js'
import { VideoPathManager } from '@server/lib/video-path-manager.js'
import { setVideoPrivacy } from '@server/lib/video-privacy.js'
import { setVideoTags } from '@server/lib/video.js'
@ -11,7 +13,9 @@ import { openapiOperationDoc } from '@server/middlewares/doc.js'
import { VideoPasswordModel } from '@server/models/video/video-password.js'
import { FilteredModelAttributes } from '@server/types/index.js'
import { MVideoFullLight, MVideoThumbnail } from '@server/types/models/index.js'
import { auditLoggerFactory, getAuditIdFromRes, VideoAuditView } from '../../../helpers/audit-logger.js'
import express, { UploadFiles } from 'express'
import { Transaction } from 'sequelize'
import { VideoAuditView, auditLoggerFactory, getAuditIdFromRes } from '../../../helpers/audit-logger.js'
import { resetSequelizeInstance } from '../../../helpers/database-utils.js'
import { createReqFiles } from '../../../helpers/express-utils.js'
import { logger, loggerTagsFactory } from '../../../helpers/logger.js'
@ -22,9 +26,6 @@ import { autoBlacklistVideoIfNeeded } from '../../../lib/video-blacklist.js'
import { asyncMiddleware, asyncRetryTransactionMiddleware, authenticate, videosUpdateValidator } from '../../../middlewares/index.js'
import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update.js'
import { VideoModel } from '../../../models/video/video.js'
import { replaceChaptersFromDescriptionIfNeeded } from '@server/lib/video-chapters.js'
import { addVideoJobsAfterUpdate } from '@server/lib/video-jobs.js'
import { updateLocalVideoMiniatureFromExisting } from '@server/lib/thumbnail.js'
const lTags = loggerTagsFactory('api', 'video')
const auditLogger = auditLoggerFactory('videos')
@ -53,7 +54,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
const oldVideoAuditView = new VideoAuditView(videoFromReq.toFormattedDetailsJSON())
const videoInfoToUpdate: VideoUpdate = req.body
const hadPrivacyForFederation = videoFromReq.hasPrivacyForFederation()
const hadPrivacyForFederation = isPrivacyForFederation(videoFromReq.privacy)
const oldPrivacy = videoFromReq.privacy
const thumbnails = await buildVideoThumbnailsFromReq(videoFromReq, req.files)
@ -192,7 +193,7 @@ async function updateVideoPrivacy (options: {
transaction: Transaction
}) {
const { videoInstance, videoInfoToUpdate, hadPrivacyForFederation, transaction } = options
const isNewVideoForFederation = videoInstance.isNewVideoForFederation(videoInfoToUpdate.privacy)
const isNewVideoForFederation = isNewVideoPrivacyForFederation(videoInstance.privacy, videoInfoToUpdate.privacy)
const newPrivacy = forceNumber(videoInfoToUpdate.privacy) as VideoPrivacyType
setVideoPrivacy(videoInstance, newPrivacy)
@ -208,7 +209,7 @@ async function updateVideoPrivacy (options: {
}
// Unfederate the video if the new privacy is not compatible with federation
if (hadPrivacyForFederation && !videoInstance.hasPrivacyForFederation()) {
if (hadPrivacyForFederation && !isPrivacyForFederation(videoInstance.privacy)) {
await VideoModel.sendDelete(videoInstance, { transaction })
}

View File

@ -1,9 +1,9 @@
import { ContextType } from '@peertube/peertube-models'
import { ACTIVITY_PUB, REMOTE_SCHEME } from '@server/initializers/constants.js'
import { isArray } from './custom-validators/misc.js'
import { buildDigest } from './peertube-crypto.js'
import type { signJsonLDObject } from './peertube-jsonld.js'
import { doJSONRequest } from './requests.js'
import { isArray } from './custom-validators/misc.js'
export type ContextFilter = <T> (arg: T) => Promise<T>
@ -49,6 +49,18 @@ export async function getApplicationActorOfHost (host: string) {
return found?.href || undefined
}
export function getAPPublicValue () {
return 'https://www.w3.org/ns/activitystreams#Public'
}
export function hasAPPublic (toOrCC: string[]) {
if (!isArray(toOrCC)) return false
const publicValue = getAPPublicValue()
return toOrCC.some(f => f === 'as:Public' || publicValue)
}
// ---------------------------------------------------------------------------
// Private
// ---------------------------------------------------------------------------
@ -58,7 +70,6 @@ type ContextValue = { [ id: string ]: (string | { '@type': string, '@id': string
const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string })[] } = {
Video: buildContext({
Hashtag: 'as:Hashtag',
uuid: 'sc:identifier',
category: 'sc:category',
licence: 'sc:license',
subtitleLanguage: 'sc:subtitleLanguage',
@ -99,6 +110,11 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string
'@id': 'pt:aspectRatio'
},
uuid: {
'@type': 'sc:identifier',
'@id': 'pt:uuid'
},
originallyPublishedAt: 'sc:datePublished',
uploadDate: 'sc:uploadDate',
@ -170,12 +186,23 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string
'@type': 'sc:Number',
'@id': 'pt:stopTimestamp'
},
uuid: 'sc:identifier'
uuid: {
'@type': 'sc:identifier',
'@id': 'pt:uuid'
}
}),
CacheFile: buildContext({
expires: 'sc:expires',
CacheFile: 'pt:CacheFile'
CacheFile: 'pt:CacheFile',
size: {
'@type': 'sc:Number',
'@id': 'pt:size'
},
fps: {
'@type': 'sc:Number',
'@id': 'pt:fps'
}
}),
Flag: buildContext({
@ -205,15 +232,21 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string
'@type': 'sc:Number',
'@id': 'pt:startTimestamp'
},
stopTimestamp: {
endTimestamp: {
'@type': 'sc:Number',
'@id': 'pt:stopTimestamp'
'@id': 'pt:endTimestamp'
},
watchSection: {
'@type': 'sc:Number',
'@id': 'pt:stopTimestamp'
uuid: {
'@type': 'sc:identifier',
'@id': 'pt:uuid'
},
uuid: 'sc:identifier'
actionStatus: 'sc:actionStatus',