]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Prefer web videos in favour of webtorrent
authorChocobozzz <me@florianbigard.com>
Tue, 11 Jul 2023 07:21:13 +0000 (09:21 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 11 Jul 2023 07:21:13 +0000 (09:21 +0200)
102 files changed:
README.md
client/e2e/src/suites-all/private-videos.e2e-spec.ts
client/e2e/src/suites-all/videos.e2e-spec.ts
client/e2e/src/utils/urls.ts
client/e2e/wdio.local-test.conf.ts
client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
client/src/app/+admin/overview/videos/video-admin.service.ts
client/src/app/+admin/overview/videos/video-list.component.html
client/src/app/+admin/overview/videos/video-list.component.ts
client/src/app/core/users/user.model.ts
client/src/app/shared/shared-main/video/video.model.ts
client/src/app/shared/shared-main/video/video.service.ts
client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
config/default.yaml
config/production.yaml.example
scripts/prune-storage.ts
server/controllers/api/runners/jobs-files.ts
server/controllers/api/users/me.ts
server/controllers/api/videos/files.ts
server/controllers/object-storage-proxy.ts
server/controllers/static.ts
server/helpers/custom-validators/metrics.ts
server/helpers/custom-validators/video-transcoding.ts
server/helpers/query.ts
server/initializers/checker-after-init.ts
server/lib/activitypub/videos/shared/abstract-builder.ts
server/lib/activitypub/videos/shared/creator.ts
server/lib/activitypub/videos/updater.ts
server/lib/job-queue/handlers/move-to-object-storage.ts
server/lib/job-queue/handlers/video-file-import.ts
server/lib/job-queue/handlers/video-import.ts
server/lib/job-queue/handlers/video-transcoding.ts
server/lib/object-storage/keys.ts
server/lib/object-storage/pre-signed-urls.ts
server/lib/object-storage/proxy.ts
server/lib/object-storage/urls.ts
server/lib/object-storage/videos.ts
server/lib/paths.ts
server/lib/plugins/plugin-helpers-builder.ts
server/lib/runners/job-handlers/shared/vod-helpers.ts
server/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts
server/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts
server/lib/schedulers/videos-redundancy-scheduler.ts
server/lib/transcoding/create-transcoding-job.ts
server/lib/transcoding/shared/job-builders/abstract-job-builder.ts
server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts
server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts
server/lib/transcoding/web-transcoding.ts
server/lib/video-file.ts
server/lib/video-path-manager.ts
server/lib/video-privacy.ts
server/lib/video-studio.ts
server/lib/video-urls.ts
server/middlewares/validators/static.ts
server/middlewares/validators/videos/video-files.ts
server/middlewares/validators/videos/videos.ts
server/models/redundancy/video-redundancy.ts
server/models/user/user.ts
server/models/video/sql/video/shared/abstract-video-query-builder.ts
server/models/video/sql/video/shared/video-file-query-builder.ts
server/models/video/sql/video/shared/video-model-builder.ts
server/models/video/sql/video/video-model-get-query-builder.ts
server/models/video/sql/video/videos-id-list-query-builder.ts
server/models/video/sql/video/videos-model-list-query-builder.ts
server/models/video/video-change-ownership.ts
server/models/video/video-file.ts
server/models/video/video.ts
server/tests/api/check-params/config.ts
server/tests/api/check-params/transcoding.ts
server/tests/api/check-params/video-files.ts
server/tests/api/object-storage/video-static-file-privacy.ts
server/tests/api/object-storage/videos.ts
server/tests/api/redundancy/redundancy.ts
server/tests/api/transcoding/audio-only.ts
server/tests/api/transcoding/create-transcoding.ts
server/tests/api/transcoding/hls.ts
server/tests/api/transcoding/transcoder.ts
server/tests/api/transcoding/update-while-transcoding.ts
server/tests/api/transcoding/video-studio.ts
server/tests/api/users/user-videos.ts
server/tests/api/users/users.ts
server/tests/api/videos/video-files.ts
server/tests/api/videos/videos-common-filters.ts
server/tests/peertube-runner/studio-transcoding.ts
server/tests/peertube-runner/vod-transcoding.ts
server/tests/plugins/plugin-helpers.ts
server/tests/plugins/plugin-transcoding.ts
server/tests/shared/videos.ts
server/tools/peertube-redundancy.ts
server/types/models/video/video-file.ts
server/types/plugins/register-server-option.model.ts
shared/models/search/videos-common-query.model.ts
shared/models/server/job.model.ts
shared/models/users/user-update-me.model.ts
shared/models/users/user.model.ts
shared/models/videos/transcoding/video-transcoding-create.model.ts
shared/server-commands/server/config-command.ts
shared/server-commands/server/servers-command.ts
shared/server-commands/videos/videos-command.ts
support/doc/api/embeds.md
support/doc/api/openapi.yaml
support/doc/tools.md

index 0c2989c62fd0b3559ac620706f0bd9ffa314f3d1..09585aa15cbb61e158d1fc88fa4bda418214d5e6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -116,7 +116,7 @@ Be it as a user or an instance administrator, you can decide what your experienc
 
 <h3 align="right">Communities that help each other</h3>
 <p align="right">
-In addition to visitors using WebTorrent to share the load among them, instances can help each other by caching one another's videos. This way even small instances have a way to show content to a wider audience, as they will be shouldered by friend instances (more about that in our <a href="https://docs.joinpeertube.org/contribute/architecture#redundancy-between-instances">redundancy guide</a>).
+In addition to visitors using P2P with WebRTC to share the load among them, instances can help each other by caching one another's videos. This way even small instances have a way to show content to a wider audience, as they will be shouldered by friend instances (more about that in our <a href="https://docs.joinpeertube.org/contribute/architecture#redundancy-between-instances">redundancy guide</a>).
 </p>
 <p align="right">
 Content creators can get help from their viewers in the simplest way possible: a support button showing a message linking to their donation accounts or really anything else. No more pay-per-view and advertisements that hurt visitors and alter creativity (more about that in our <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/FAQ.md">FAQ</a>).
index a25208bb3a8a43ded45da8a74973ef1f2ba52cad..829d76a841e1224b0fcb3677779d022d2b5f9b5d 100644 (file)
@@ -31,8 +31,8 @@ describe('Private videos all workflow', () => {
     return loginPage.loginOnPeerTube2()
   })
 
-  it('Should play an internal webtorrent video', async () => {
-    await go(FIXTURE_URLS.INTERNAL_WEBTORRENT_VIDEO)
+  it('Should play an internal web video video', async () => {
+    await go(FIXTURE_URLS.INTERNAL_WEB_VIDEO)
 
     await videoWatchPage.waitWatchVideoName(internalVideoName)
     await checkCorrectlyPlay(playerPage)
@@ -52,8 +52,8 @@ describe('Private videos all workflow', () => {
     await checkCorrectlyPlay(playerPage)
   })
 
-  it('Should play an internal WebTorrent video in embed', async () => {
-    await go(FIXTURE_URLS.INTERNAL_EMBED_WEBTORRENT_VIDEO)
+  it('Should play an internal Web Video in embed', async () => {
+    await go(FIXTURE_URLS.INTERNAL_EMBED_WEB_VIDEO)
 
     await videoWatchPage.waitEmbedForDisplayed()
     await checkCorrectlyPlay(playerPage)
index d1ab9aef3dca0ea4d94f1f8cfedfadfd9cb9c742..5d0f8c152b88a2edfffb3ab99bb364023650069f 100644 (file)
@@ -89,7 +89,7 @@ describe('Videos all workflow', () => {
     let videoNameToExcept = videoName
 
     if (isMobileDevice() || isSafari()) {
-      await go(FIXTURE_URLS.WEBTORRENT_VIDEO)
+      await go(FIXTURE_URLS.WEB_VIDEO)
       videoNameToExcept = 'E2E tests'
     } else {
       await videoListPage.clickOnVideo(videoName)
@@ -176,7 +176,7 @@ describe('Videos all workflow', () => {
     await videoWatchPage.waitUntilVideoName(video2Name, 40 * 1000)
   })
 
-  it('Should watch the webtorrent playlist in the embed', async () => {
+  it('Should watch the WEB VIDEO playlist in the embed', async () => {
     if (isUploadUnsupported()) return
 
     const accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`)
index cc0bdfbff32a45a8caaa76206cab4885473dde84..eafe0aa5df981e6eb139d18f69141209cd68d509 100644 (file)
@@ -1,14 +1,14 @@
 const FIXTURE_URLS = {
-  INTERNAL_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0',
+  INTERNAL_WEB_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0',
   INTERNAL_HLS_VIDEO: 'https://peertube2.cpy.re/w/pwfz7NizSdPD4mJcbbmNwa?start=0',
 
-  INTERNAL_EMBED_WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=webtorrent&start=0',
+  INTERNAL_EMBED_WEB_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?mode=web-video&start=0',
   INTERNAL_EMBED_HLS_VIDEO: 'https://peertube2.cpy.re/videos/embed/pwfz7NizSdPD4mJcbbmNwa?start=0',
 
   INTERNAL_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/w/tKQmHcqdYZRdCszLUiWM3V?start=0',
   INTERNAL_EMBED_HLS_ONLY_VIDEO: 'https://peertube2.cpy.re/videos/embed/tKQmHcqdYZRdCszLUiWM3V?start=0',
 
-  WEBTORRENT_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
+  WEB_VIDEO: 'https://peertube2.cpy.re/w/122d093a-1ede-43bd-bd34-59d2931ffc5e',
 
   HLS_EMBED: 'https://peertube2.cpy.re/videos/embed/969bf103-7818-43b5-94a0-de159e13de50',
   HLS_PLAYLIST_EMBED: 'https://peertube2.cpy.re/video-playlists/embed/73804a40-da9a-40c2-b1eb-2c6d9eec8f0a',
index 96ddc67cace96242d173a0fa75fd38467f9b7a88..6c01713726dab25ea95ba2ed6f37b18768e8ee77 100644 (file)
@@ -24,19 +24,19 @@ module.exports = {
     specFileRetries: 0,
 
     capabilities: [
-      {
-        'browserName': 'chrome',
-        'acceptInsecureCerts': true,
-        'goog:chromeOptions': {
-          args: [ '--disable-gpu', windowSizeArg ],
-          prefs
-        }
-      },
+      // {
+      //   'browserName': 'chrome',
+      //   'acceptInsecureCerts': true,
+      //   'goog:chromeOptions': {
+      //     args: [ '--disable-gpu', windowSizeArg ],
+      //     prefs
+      //   }
+      // },
       {
         'browserName': 'firefox',
         'moz:firefoxOptions': {
           binary: '/usr/bin/firefox-developer-edition',
-          args: [ '--headless', windowSizeArg ],
+          // args: [ '--headless', windowSizeArg ],
 
           prefs
         }
index fb750aca6b6cda8387da48b551fdcd3437934cce..7218511a9c5c23064c0f8896c3d421bcff90e16b 100644 (file)
@@ -71,7 +71,7 @@
                   <div class="form-group" [ngClass]="getTranscodingDisabledClass()">
                     <my-peertube-checkbox
                       inputName="transcodingWebTorrentEnabled" formControlName="enabled"
-                      i18n-labelText labelText="WebTorrent enabled"
+                      i18n-labelText labelText="Web Videos enabled"
                     >
                       <ng-template ptTemplate="help">
                         <ng-container>
                         <ng-container i18n>
                           <strong>Requires ffmpeg >= 4.1</strong>
 
-                          <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with plain WebTorrent:</p>
+                          <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with Web Videos:</p>
                           <ul>
                             <li>Resolution change is smoother</li>
                             <li>Faster playback especially with long videos</li>
                             <li>More stable playback (less bugs/infinite loading)</li>
                           </ul>
 
-                          <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p>
+                          <p>If you also enabled Web Videos support, it will multiply videos storage by 2</p>
                         </ng-container>
                       </ng-template>
                     </my-peertube-checkbox>
index 195b265a1f06fb7edfc6f4e28da646da977d8a93..7224957068970771795e80212fa57f968d996d15 100644 (file)
@@ -59,12 +59,12 @@ export class VideoAdminService {
         title: $localize`Video files`,
         children: [
           {
-            value: 'webtorrent:true isLocal:true',
-            label: $localize`With WebTorrent`
+            value: 'webVideos:true isLocal:true',
+            label: $localize`With Web Videos`
           },
           {
-            value: 'webtorrent:false isLocal:true',
-            label: $localize`Without WebTorrent`
+            value: 'webVideos:false isLocal:true',
+            label: $localize`Without Web Videos`
           },
           {
             value: 'hls:true isLocal:true',
@@ -126,8 +126,8 @@ export class VideoAdminService {
         prefix: 'hls:',
         isBoolean: true
       },
-      hasWebtorrentFiles: {
-        prefix: 'webtorrent:',
+      hasWebVideoFiles: {
+        prefix: 'webVideos:',
         isBoolean: true
       },
       isLive: {
index c4f78cadc7f7f56224dcb8d6d9dc3259f9f3b30a..3a4666435c273f62aac659c19c0e2faaf17061be 100644 (file)
@@ -83,8 +83,8 @@
       </td>
 
       <td>
-        <span *ngIf="isHLS(video)" class="pt-badge badge-blue">HLS</span>
-        <span *ngIf="isWebTorrent(video)" class="pt-badge badge-blue">WebTorrent ({{ video.files.length }})</span>
+        <span *ngIf="hasHLS(video)" class="pt-badge badge-blue">HLS</span>
+        <span *ngIf="hasWebVideos(video)" class="pt-badge badge-blue">Web Videos ({{ video.files.length }})</span>
         <span i18n *ngIf="video.isLive" class="pt-badge badge-blue">Live</span>
         <span i18n *ngIf="hasObjectStorage(video)" class="pt-badge badge-purple">Object storage</span>
 
     <tr>
       <td class="video-info expand-cell" myAutoColspan>
         <div>
-          <div *ngIf="isWebTorrent(video)">
-            WebTorrent:
+          <div *ngIf="hasWebVideos(video)">
+            Web Videos:
 
             <ul>
               <li *ngFor="let file of video.files">
                 <my-global-icon
                   *ngIf="canRemoveOneFile(video)"
                   i18n-ngbTooltip ngbTooltip="Delete this file" iconName="delete" role="button"
-                  (click)="removeVideoFile(video, file, 'webtorrent')"
+                  (click)="removeVideoFile(video, file, 'web-videos')"
                 ></my-global-icon>
               </li>
             </ul>
           </div>
 
-          <div *ngIf="isHLS(video)">
+          <div *ngIf="hasHLS(video)">
             HLS:
 
             <ul>
index e9c52619375d2653655197f0e28aa13767dd8e0b..52f02d8d041aedd44761a23b49d44e4064fd6d39 100644 (file)
@@ -99,8 +99,8 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
           iconName: 'cog'
         },
         {
-          label: $localize`Run WebTorrent transcoding`,
-          handler: videos => this.runTranscoding(videos, 'webtorrent'),
+          label: $localize`Run Web Video transcoding`,
+          handler: videos => this.runTranscoding(videos, 'web-video'),
           isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)),
           iconName: 'cog'
         },
@@ -111,8 +111,8 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
           iconName: 'delete'
         },
         {
-          label: $localize`Delete WebTorrent files`,
-          handler: videos => this.removeVideoFiles(videos, 'webtorrent'),
+          label: $localize`Delete Web Video files`,
+          handler: videos => this.removeVideoFiles(videos, 'web-videos'),
           isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)),
           iconName: 'delete'
         }
@@ -150,14 +150,14 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
     return video.state.id === VideoState.TO_IMPORT
   }
 
-  isHLS (video: Video) {
+  hasHLS (video: Video) {
     const p = video.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS)
     if (!p) return false
 
     return p.files.length !== 0
   }
 
-  isWebTorrent (video: Video) {
+  hasWebVideos (video: Video) {
     return video.files.length !== 0
   }
 
@@ -176,14 +176,14 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
   getFilesSize (video: Video) {
     let files = video.files
 
-    if (this.isHLS(video)) {
+    if (this.hasHLS(video)) {
       files = files.concat(video.streamingPlaylists[0].files)
     }
 
     return files.reduce((p, f) => p += f.size, 0)
   }
 
-  async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
+  async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'web-videos') {
     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
@@ -262,7 +262,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
       })
   }
 
-  private async removeVideoFiles (videos: Video[], type: 'hls' | 'webtorrent') {
+  private async removeVideoFiles (videos: Video[], type: 'hls' | 'web-videos') {
     let message: string
 
     if (type === 'hls') {
@@ -274,7 +274,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
     } else {
       // eslint-disable-next-line max-len
       message = formatICU(
-        $localize`Are you sure you want to delete WebTorrent files of {count, plural, =1 {1 video} other {{count} videos}}?`,
+        $localize`Are you sure you want to delete Web Video files of {count, plural, =1 {1 video} other {{count} videos}}?`,
         { count: videos.length }
       )
     }
@@ -293,7 +293,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
       })
   }
 
-  private runTranscoding (videos: Video[], type: 'hls' | 'webtorrent') {
+  private runTranscoding (videos: Video[], type: 'hls' | 'web-video') {
     this.videoService.runTranscoding(videos.map(v => v.id), type)
       .subscribe({
         next: () => {
index d57608f1c66310b04debe4cc738b95e3f570ee8a..5aa02e472b0cc91ac7960aba060465791f640852 100644 (file)
@@ -30,8 +30,6 @@ export class User implements UserServerModel {
   autoPlayNextVideoPlaylist: boolean
 
   p2pEnabled: boolean
-  // FIXME: deprecated in 4.1
-  webTorrentEnabled: never
 
   videosHistoryEnabled: boolean
   videoLanguages: string[]
index e94087dbe379e1a192ce3c00d13a71e8a05107c3..1ffc404112c71b7ea4d8fc69a9430e1a738c5040 100644 (file)
@@ -252,7 +252,7 @@ export class Video implements VideoServerModel {
       user && user.hasRight(UserRight.MANAGE_VIDEO_FILES) &&
       this.state.id !== VideoState.TO_TRANSCODE &&
       this.hasHLS() &&
-      this.hasWebTorrent()
+      this.hasWebVideos()
   }
 
   canRunTranscoding (user: AuthUser) {
@@ -265,7 +265,7 @@ export class Video implements VideoServerModel {
     return this.streamingPlaylists?.some(p => p.type === VideoStreamingPlaylistType.HLS)
   }
 
-  hasWebTorrent () {
+  hasWebVideos () {
     return this.files && this.files.length !== 0
   }
 
index 4e8b84dfc9fe7268da67ba0ee195add3942bd682..20145b9c5a16136eb387ebdf1e36baaf082c13a9 100644 (file)
@@ -311,7 +311,7 @@ export class VideoService {
       )
   }
 
-  removeVideoFiles (videoIds: (number | string)[], type: 'hls' | 'webtorrent') {
+  removeVideoFiles (videoIds: (number | string)[], type: 'hls' | 'web-videos') {
     return from(videoIds)
       .pipe(
         concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id + '/' + type)),
@@ -320,12 +320,12 @@ export class VideoService {
       )
   }
 
-  removeFile (videoId: number | string, fileId: number, type: 'hls' | 'webtorrent') {
+  removeFile (videoId: number | string, fileId: number, type: 'hls' | 'web-videos') {
     return this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + videoId + '/' + type + '/' + fileId)
       .pipe(catchError(err => this.restExtractor.handleError(err)))
   }
 
-  runTranscoding (videoIds: (number | string)[], type: 'hls' | 'webtorrent') {
+  runTranscoding (videoIds: (number | string)[], type: 'hls' | 'web-video') {
     const body: VideoTranscodingCreate = { transcodingType: type }
 
     return from(videoIds)
index 56527ddfaf84baf8383c175207d12d727f0630bb..0a3ada7113a9baaea38f5c02bbb017bebd81e112 100644 (file)
@@ -273,7 +273,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
         })
   }
 
-  async removeVideoFiles (video: Video, type: 'hls' | 'webtorrent') {
+  async removeVideoFiles (video: Video, type: 'hls' | 'web-videos') {
     const confirmMessage = $localize`Do you really want to remove "${this.video.name}" files?`
 
     const res = await this.confirmService.confirm(confirmMessage, $localize`Remove "${this.video.name}" files`)
@@ -290,7 +290,7 @@ export class VideoActionsDropdownComponent implements OnChanges {
       })
   }
 
-  runTranscoding (video: Video, type: 'hls' | 'webtorrent') {
+  runTranscoding (video: Video, type: 'hls' | 'web-video') {
     this.videoService.runTranscoding([ video.id ], type)
       .subscribe({
         next: () => {
@@ -394,8 +394,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
           iconName: 'cog'
         },
         {
-          label: $localize`Run WebTorrent transcoding`,
-          handler: ({ video }) => this.runTranscoding(video, 'webtorrent'),
+          label: $localize`Run Web Video transcoding`,
+          handler: ({ video }) => this.runTranscoding(video, 'web-video'),
           isDisplayed: () => this.displayOptions.transcoding && this.canRunTranscoding(),
           iconName: 'cog'
         },
@@ -406,8 +406,8 @@ export class VideoActionsDropdownComponent implements OnChanges {
           iconName: 'delete'
         },
         {
-          label: $localize`Delete WebTorrent files`,
-          handler: ({ video }) => this.removeVideoFiles(video, 'webtorrent'),
+          label: $localize`Delete Web Video files`,
+          handler: ({ video }) => this.removeVideoFiles(video, 'web-videos'),
           isDisplayed: () => this.displayOptions.removeFiles && this.canRemoveVideoFiles(),
           iconName: 'delete'
         }
index e54c93ac5275ba1b2c870f658c8f222d02a49d4b..6f78fb7e92ea9a27e972a6a0b747caa91d2758bd 100644 (file)
@@ -201,7 +201,7 @@ object_storage:
     # Useful when you want to use a CDN/external proxy
     base_url: '' # Example: 'https://mirror.example.com'
 
-  # Same settings but for webtorrent videos
+  # Same settings but for web videos
   videos:
     bucket_name: 'videos'
     prefix: ''
@@ -480,18 +480,18 @@ transcoding:
   # Transcode and keep original resolution, even if it's above your maximum enabled resolution
   always_transcode_original_resolution: true
 
-  # Generate videos in a WebTorrent format (what we do since the first PeerTube release)
+  # Generate videos in a web compatible format
   # If you also enabled the hls format, it will multiply videos storage by 2
   # If disabled, breaks federation with PeerTube instances < 2.1
   webtorrent:
     enabled: false
 
   # /!\ Requires ffmpeg >= 4.1
-  # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
+  # Generate HLS playlists and fragmented MP4 files. Better playback than with Web Videos:
   #     * Resolution change is smoother
   #     * Faster playback in particular with long videos
   #     * More stable playback (less bugs/infinite loading)
-  # If you also enabled the webtorrent format, it will multiply videos storage by 2
+  # If you also enabled the web videos format, it will multiply videos storage by 2
   hls:
     enabled: true
 
index 83ee48daedf2199f7f92144c8c9867860ecdcb67..2898a45ac728b19cdc13573b80479af7daa7ce88 100644 (file)
@@ -199,7 +199,7 @@ object_storage:
     # Useful when you want to use a CDN/external proxy
     base_url: '' # Example: 'https://mirror.example.com'
 
-  # Same settings but for webtorrent videos
+  # Same settings but for web videos
   videos:
     bucket_name: 'videos'
     prefix: ''
@@ -490,18 +490,18 @@ transcoding:
   # Transcode and keep original resolution, even if it's above your maximum enabled resolution
   always_transcode_original_resolution: true
 
-  # Generate videos in a WebTorrent format (what we do since the first PeerTube release)
+  # Generate videos in a web compatible format
   # If you also enabled the hls format, it will multiply videos storage by 2
   # If disabled, breaks federation with PeerTube instances < 2.1
   webtorrent:
     enabled: false
 
   # /!\ Requires ffmpeg >= 4.1
-  # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
+  # Generate HLS playlists and fragmented MP4 files. Better playback than with Web Videos:
   #     * Resolution change is smoother
   #     * Faster playback in particular with long videos
   #     * More stable playback (less bugs/infinite loading)
-  # If you also enabled the webtorrent format, it will multiply videos storage by 2
+  # If you also enabled the web videos format, it will multiply videos storage by 2
   hls:
     enabled: true
 
@@ -599,7 +599,6 @@ video_studio:
   # If enabled, users can create transcoding tasks as they wish
   enabled: false
 
-
   # Enable remote runners to transcode studio tasks
   # If enabled, your instance won't transcode the videos itself
   # At least 1 remote runner must be configured to transcode your videos
index d19594a60ed45122fb497e83344422a44cd43b5f..8d1ded59bbfc98486dba5e1e0bb51dba1053425e 100755 (executable)
@@ -37,8 +37,8 @@ async function run () {
   console.log('Detecting files to remove, it could take a while...')
 
   toDelete = toDelete.concat(
-    await pruneDirectory(DIRECTORIES.VIDEOS.PUBLIC, doesWebTorrentFileExist()),
-    await pruneDirectory(DIRECTORIES.VIDEOS.PRIVATE, doesWebTorrentFileExist()),
+    await pruneDirectory(DIRECTORIES.VIDEOS.PUBLIC, doesWebVideoFileExist()),
+    await pruneDirectory(DIRECTORIES.VIDEOS.PRIVATE, doesWebVideoFileExist()),
 
     await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, doesHLSPlaylistExist()),
     await pruneDirectory(DIRECTORIES.HLS_STREAMING_PLAYLIST.PUBLIC, doesHLSPlaylistExist()),
@@ -93,12 +93,12 @@ async function pruneDirectory (directory: string, existFun: ExistFun) {
   return toDelete
 }
 
-function doesWebTorrentFileExist () {
+function doesWebVideoFileExist () {
   return (filePath: string) => {
     // Don't delete private directory
     if (filePath === DIRECTORIES.VIDEOS.PRIVATE) return true
 
-    return VideoFileModel.doesOwnedWebTorrentVideoFileExist(basename(filePath))
+    return VideoFileModel.doesOwnedWebVideoFileExist(basename(filePath))
   }
 }
 
index 4e69fb9023ada87a04c713ec7408b25af6c97be7..cb4eff570c41a0168a8e984f20d62666ac49fd26 100644 (file)
@@ -1,6 +1,6 @@
 import express from 'express'
 import { logger, loggerTagsFactory } from '@server/helpers/logger'
-import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage'
+import { proxifyHLS, proxifyWebVideoFile } from '@server/lib/object-storage'
 import { VideoPathManager } from '@server/lib/video-path-manager'
 import { getStudioTaskFilePath } from '@server/lib/video-studio'
 import { apiRateLimiter, asyncMiddleware } from '@server/middlewares'
@@ -70,7 +70,7 @@ async function getMaxQualityVideoFile (req: express.Request, res: express.Respon
     }
 
     // Web video
-    return proxifyWebTorrentFile({
+    return proxifyWebVideoFile({
       req,
       res,
       filename: file.filename
index 218091d9167c48dbe0fbd8fd3dcaa0ef7ca4f1d2..4753308e8bb6370dac71e5c71bfc3082b789bbe7 100644 (file)
@@ -213,19 +213,14 @@ async function updateMe (req: express.Request, res: express.Response) {
     'noInstanceConfigWarningModal',
     'noAccountSetupWarningModal',
     'noWelcomeModal',
-    'emailPublic'
+    'emailPublic',
+    'p2pEnabled'
   ]
 
   for (const key of keysToUpdate) {
     if (body[key] !== undefined) user.set(key, body[key])
   }
 
-  if (body.p2pEnabled !== undefined) {
-    user.set('p2pEnabled', body.p2pEnabled)
-  } else if (body.webTorrentEnabled !== undefined) { // FIXME: deprecated in 4.1
-    user.set('p2pEnabled', body.webTorrentEnabled)
-  }
-
   if (body.email !== undefined) {
     if (CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
       user.pendingEmail = body.email
index 6d9c0b843a90c769a01de7367b0ee1b1db2b3357..67b60ff639855ff54678e45aff773f29a72893f1 100644 (file)
@@ -2,7 +2,8 @@ import express from 'express'
 import toInt from 'validator/lib/toInt'
 import { logger, loggerTagsFactory } from '@server/helpers/logger'
 import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
-import { removeAllWebTorrentFiles, removeHLSFile, removeHLSPlaylist, removeWebTorrentFile } from '@server/lib/video-file'
+import { updatePlaylistAfterFileChange } from '@server/lib/hls'
+import { removeAllWebVideoFiles, removeHLSFile, removeHLSPlaylist, removeWebVideoFile } from '@server/lib/video-file'
 import { VideoFileModel } from '@server/models/video/video-file'
 import { HttpStatusCode, UserRight } from '@shared/models'
 import {
@@ -12,11 +13,10 @@ import {
   videoFileMetadataGetValidator,
   videoFilesDeleteHLSFileValidator,
   videoFilesDeleteHLSValidator,
-  videoFilesDeleteWebTorrentFileValidator,
-  videoFilesDeleteWebTorrentValidator,
+  videoFilesDeleteWebVideoFileValidator,
+  videoFilesDeleteWebVideoValidator,
   videosGetValidator
 } from '../../../middlewares'
-import { updatePlaylistAfterFileChange } from '@server/lib/hls'
 
 const lTags = loggerTagsFactory('api', 'video')
 const filesRouter = express.Router()
@@ -40,17 +40,19 @@ filesRouter.delete('/:id/hls/:videoFileId',
   asyncMiddleware(removeHLSFileController)
 )
 
-filesRouter.delete('/:id/webtorrent',
+filesRouter.delete(
+  [ '/:id/webtorrent', '/:id/web-videos' ], // TODO: remove webtorrent in V7
   authenticate,
   ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
-  asyncMiddleware(videoFilesDeleteWebTorrentValidator),
-  asyncMiddleware(removeAllWebTorrentFilesController)
+  asyncMiddleware(videoFilesDeleteWebVideoValidator),
+  asyncMiddleware(removeAllWebVideoFilesController)
 )
-filesRouter.delete('/:id/webtorrent/:videoFileId',
+filesRouter.delete(
+  [ '/:id/webtorrent/:videoFileId', '/:id/web-videos/:videoFileId' ], // TODO: remove webtorrent in V7
   authenticate,
   ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
-  asyncMiddleware(videoFilesDeleteWebTorrentFileValidator),
-  asyncMiddleware(removeWebTorrentFileController)
+  asyncMiddleware(videoFilesDeleteWebVideoFileValidator),
+  asyncMiddleware(removeWebVideoFileController)
 )
 
 // ---------------------------------------------------------------------------
@@ -96,24 +98,24 @@ async function removeHLSFileController (req: express.Request, res: express.Respo
 
 // ---------------------------------------------------------------------------
 
-async function removeAllWebTorrentFilesController (req: express.Request, res: express.Response) {
+async function removeAllWebVideoFilesController (req: express.Request, res: express.Response) {
   const video = res.locals.videoAll
 
-  logger.info('Deleting WebTorrent files of %s.', video.url, lTags(video.uuid))
+  logger.info('Deleting Web Video files of %s.', video.url, lTags(video.uuid))
 
-  await removeAllWebTorrentFiles(video)
+  await removeAllWebVideoFiles(video)
   await federateVideoIfNeeded(video, false, undefined)
 
   return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
 }
 
-async function removeWebTorrentFileController (req: express.Request, res: express.Response) {
+async function removeWebVideoFileController (req: express.Request, res: express.Response) {
   const video = res.locals.videoAll
 
   const videoFileId = +req.params.videoFileId
-  logger.info('Deleting WebTorrent file %d of %s.', videoFileId, video.url, lTags(video.uuid))
+  logger.info('Deleting Web Video file %d of %s.', videoFileId, video.url, lTags(video.uuid))
 
-  await removeWebTorrentFile(video, videoFileId)
+  await removeWebVideoFile(video, videoFileId)
   await federateVideoIfNeeded(video, false, undefined)
 
   return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
index 8e2cc4af985592b25a440d6cf3c3adbe42967c33..0edde64fe94534a7d3802e73650521342219f516 100644 (file)
@@ -1,11 +1,11 @@
 import cors from 'cors'
 import express from 'express'
 import { OBJECT_STORAGE_PROXY_PATHS } from '@server/initializers/constants'
-import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage'
+import { proxifyHLS, proxifyWebVideoFile } from '@server/lib/object-storage'
 import {
   asyncMiddleware,
   ensureCanAccessPrivateVideoHLSFiles,
-  ensureCanAccessVideoPrivateWebTorrentFiles,
+  ensureCanAccessVideoPrivateWebVideoFiles,
   ensurePrivateObjectStorageProxyIsEnabled,
   optionalAuthenticate
 } from '@server/middlewares'
@@ -18,8 +18,8 @@ objectStorageProxyRouter.use(cors())
 objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEBSEED + ':filename',
   ensurePrivateObjectStorageProxyIsEnabled,
   optionalAuthenticate,
-  asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles),
-  asyncMiddleware(proxifyWebTorrentController)
+  asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles),
+  asyncMiddleware(proxifyWebVideoController)
 )
 
 objectStorageProxyRouter.get(OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + ':videoUUID/:filename',
@@ -35,10 +35,10 @@ export {
   objectStorageProxyRouter
 }
 
-function proxifyWebTorrentController (req: express.Request, res: express.Response) {
+function proxifyWebVideoController (req: express.Request, res: express.Response) {
   const filename = req.params.filename
 
-  return proxifyWebTorrentFile({ req, res, filename })
+  return proxifyWebVideoFile({ req, res, filename })
 }
 
 function proxifyHLSController (req: express.Request, res: express.Response) {
index bbd0dd0119887d5f2cea676bfbbc4b3c856cabdc..5ce739bfc34b0e9551820996048897ce40d10f8c 100644 (file)
@@ -6,7 +6,7 @@ import { injectQueryToPlaylistUrls } from '@server/lib/hls'
 import {
   asyncMiddleware,
   ensureCanAccessPrivateVideoHLSFiles,
-  ensureCanAccessVideoPrivateWebTorrentFiles,
+  ensureCanAccessVideoPrivateWebVideoFiles,
   handleStaticError,
   optionalAuthenticate
 } from '@server/middlewares'
@@ -21,16 +21,16 @@ const staticRouter = express.Router()
 staticRouter.use(cors())
 
 // ---------------------------------------------------------------------------
-// WebTorrent/Classic videos
+// Web videos/Classic videos
 // ---------------------------------------------------------------------------
 
-const privateWebTorrentStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true
-  ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebTorrentFiles) ]
+const privateWebVideoStaticMiddlewares = CONFIG.STATIC_FILES.PRIVATE_FILES_REQUIRE_AUTH === true
+  ? [ optionalAuthenticate, asyncMiddleware(ensureCanAccessVideoPrivateWebVideoFiles) ]
   : []
 
 staticRouter.use(
   STATIC_PATHS.PRIVATE_WEBSEED,
-  ...privateWebTorrentStaticMiddlewares,
+  ...privateWebVideoStaticMiddlewares,
   express.static(DIRECTORIES.VIDEOS.PRIVATE, { fallthrough: false }),
   handleStaticError
 )
index 533f8988d9edbcf8c18c9d399fb696f0095ca987..44a863630a54325f7e0139e4eb462555aa6cb68d 100644 (file)
@@ -1,5 +1,6 @@
 function isValidPlayerMode (value: any) {
-  return value === 'webtorrent' || value === 'p2p-media-loader'
+  // TODO: remove webtorrent in v7
+  return value === 'webtorrent' || value === 'web-video' || value === 'p2p-media-loader'
 }
 
 // ---------------------------------------------------------------------------
index cf792f9964aa3df69f185833be8d3b11f0d97481..220530de428bb2f3b0a31a7d11742e9bf0ba9806 100644 (file)
@@ -2,7 +2,7 @@ import { exists } from './misc'
 
 function isValidCreateTranscodingType (value: any) {
   return exists(value) &&
-    (value === 'hls' || value === 'webtorrent')
+    (value === 'hls' || value === 'webtorrent' || value === 'web-video') // TODO: remove webtorrent in v7
 }
 
 // ---------------------------------------------------------------------------
index 10efae41cf31e3de7ba1833d2ed5afc591c7f21c..c0f78368fc8cb7ae6555d647b3c19b72d45fd294 100644 (file)
@@ -23,7 +23,8 @@ function pickCommonVideoQuery (query: VideosCommonQueryAfterSanitize) {
     'include',
     'skipCount',
     'hasHLSFiles',
-    'hasWebtorrentFiles',
+    'hasWebtorrentFiles', // TODO: Remove in v7
+    'hasWebVideoFiles',
     'search',
     'excludeAlreadyWatched'
   ])
index 68dea909d271cf357fc7507ffc76f094de86253b..21bc5911cddcb1b05a739e5359a0308c3d720a31 100644 (file)
@@ -199,7 +199,7 @@ function checkStorageConfig () {
 function checkTranscodingConfig () {
   if (CONFIG.TRANSCODING.ENABLED) {
     if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) {
-      throw new Error('You need to enable at least WebTorrent transcoding or HLS transcoding.')
+      throw new Error('You need to enable at least Web Video transcoding or HLS transcoding.')
     }
 
     if (CONFIG.TRANSCODING.CONCURRENCY <= 0) {
index 8b6a7fd7542a3c31de4d56802a21e690db59eee8..98c2f58eb47dd23aadaa47caf9ee8ea822b86071 100644 (file)
@@ -126,7 +126,7 @@ export abstract class APVideoAbstractBuilder {
     video.VideoLive = videoLive
   }
 
-  protected async setWebTorrentFiles (video: MVideoFullLight, t: Transaction) {
+  protected async setWebVideoFiles (video: MVideoFullLight, t: Transaction) {
     const videoFileAttributes = getFileAttributesFromUrl(video, this.videoObject.url)
     const newVideoFiles = videoFileAttributes.map(a => new VideoFileModel(a))
 
index 3d646ef66eb16b6c4c6e96f82af106bb470b39d4..bc139e4faff55c0df91d94efa12743ae74218aa5 100644 (file)
@@ -33,7 +33,7 @@ export class APVideoCreator extends APVideoAbstractBuilder {
 
       await this.setThumbnail(videoCreated, t)
       await this.setPreview(videoCreated, t)
-      await this.setWebTorrentFiles(videoCreated, t)
+      await this.setWebVideoFiles(videoCreated, t)
       await this.setStreamingPlaylists(videoCreated, t)
       await this.setTags(videoCreated, t)
       await this.setTrackers(videoCreated, t)
index c98bce66220c529d461fe785cb97eec17ddec21f..522d7b0438872915487a39f17be5ca9451163e64 100644 (file)
@@ -50,7 +50,7 @@ export class APVideoUpdater extends APVideoAbstractBuilder {
       if (thumbnailModel) await videoUpdated.addAndSaveThumbnail(thumbnailModel)
 
       await runInReadCommittedTransaction(async t => {
-        await this.setWebTorrentFiles(videoUpdated, t)
+        await this.setWebVideoFiles(videoUpdated, t)
         await this.setStreamingPlaylists(videoUpdated, t)
       })
 
index 26752ff37def714f1713453eb5c8288f7deb6382..9a99b672279678760401b35854625e4de54e7f53 100644 (file)
@@ -4,7 +4,7 @@ import { join } from 'path'
 import { logger, loggerTagsFactory } from '@server/helpers/logger'
 import { updateTorrentMetadata } from '@server/helpers/webtorrent'
 import { P2P_MEDIA_LOADER_PEER_VERSION } from '@server/initializers/constants'
-import { storeHLSFileFromFilename, storeWebTorrentFile } from '@server/lib/object-storage'
+import { storeHLSFileFromFilename, storeWebVideoFile } from '@server/lib/object-storage'
 import { getHLSDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths'
 import { VideoPathManager } from '@server/lib/video-path-manager'
 import { moveToFailedMoveToObjectStorageState, moveToNextState } from '@server/lib/video-state'
@@ -33,9 +33,9 @@ export async function processMoveToObjectStorage (job: Job) {
 
   try {
     if (video.VideoFiles) {
-      logger.debug('Moving %d webtorrent files for video %s.', video.VideoFiles.length, video.uuid, lTags)
+      logger.debug('Moving %d web video files for video %s.', video.VideoFiles.length, video.uuid, lTags)
 
-      await moveWebTorrentFiles(video)
+      await moveWebVideoFiles(video)
     }
 
     if (video.VideoStreamingPlaylists) {
@@ -75,11 +75,11 @@ export async function onMoveToObjectStorageFailure (job: Job, err: any) {
 
 // ---------------------------------------------------------------------------
 
-async function moveWebTorrentFiles (video: MVideoWithAllFiles) {
+async function moveWebVideoFiles (video: MVideoWithAllFiles) {
   for (const file of video.VideoFiles) {
     if (file.storage !== VideoStorage.FILE_SYSTEM) continue
 
-    const fileUrl = await storeWebTorrentFile(video, file)
+    const fileUrl = await storeWebVideoFile(video, file)
 
     const oldPath = VideoPathManager.Instance.getFSVideoFileOutputPath(video, file)
     await onFileMoved({ videoOrPlaylist: video, file, fileUrl, oldPath })
index 9a4550e4de06415f6d57e20b365774bc226519a4..d221e896803f87a54fc12b64d6b630bd7373948d 100644 (file)
@@ -3,7 +3,7 @@ import { copy, stat } from 'fs-extra'
 import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent'
 import { CONFIG } from '@server/initializers/config'
 import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
-import { generateWebTorrentVideoFilename } from '@server/lib/paths'
+import { generateWebVideoFilename } from '@server/lib/paths'
 import { buildMoveToObjectStorageJob } from '@server/lib/video'
 import { VideoPathManager } from '@server/lib/video-path-manager'
 import { VideoModel } from '@server/models/video/video'
@@ -56,7 +56,7 @@ async function updateVideoFile (video: MVideoFullLight, inputFilePath: string) {
 
   if (currentVideoFile) {
     // Remove old file and old torrent
-    await video.removeWebTorrentFile(currentVideoFile)
+    await video.removeWebVideoFile(currentVideoFile)
     // Remove the old video file from the array
     video.VideoFiles = video.VideoFiles.filter(f => f !== currentVideoFile)
 
@@ -66,7 +66,7 @@ async function updateVideoFile (video: MVideoFullLight, inputFilePath: string) {
   const newVideoFile = new VideoFileModel({
     resolution,
     extname: fileExt,
-    filename: generateWebTorrentVideoFilename(resolution, fileExt),
+    filename: generateWebVideoFilename(resolution, fileExt),
     storage: VideoStorage.FILE_SYSTEM,
     size,
     fps,
index 436bf31759b4006f65293965b61c98c171fe36ae..e5cd258d6298155e8e8a58d430a9b31c0454af82 100644 (file)
@@ -4,7 +4,7 @@ import { retryTransactionWrapper } from '@server/helpers/database-utils'
 import { YoutubeDLWrapper } from '@server/helpers/youtube-dl'
 import { CONFIG } from '@server/initializers/config'
 import { isPostImportVideoAccepted } from '@server/lib/moderation'
-import { generateWebTorrentVideoFilename } from '@server/lib/paths'
+import { generateWebVideoFilename } from '@server/lib/paths'
 import { Hooks } from '@server/lib/plugins/hooks'
 import { ServerConfigManager } from '@server/lib/server-config-manager'
 import { createOptimizeOrMergeAudioJobs } from '@server/lib/transcoding/create-transcoding-job'
@@ -148,7 +148,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: MVid
       extname: fileExt,
       resolution,
       size: stats.size,
-      filename: generateWebTorrentVideoFilename(resolution, fileExt),
+      filename: generateWebVideoFilename(resolution, fileExt),
       fps,
       videoId: videoImport.videoId
     }
index f8758f1702d5e08a45dd09bcdac5415d90aaaa20..1c8f4fd9f4f5da7f0b26ee83fa1de15ce16235db 100644 (file)
@@ -1,8 +1,8 @@
 import { Job } from 'bullmq'
 import { onTranscodingEnded } from '@server/lib/transcoding/ended-transcoding'
 import { generateHlsPlaylistResolution } from '@server/lib/transcoding/hls-transcoding'
-import { mergeAudioVideofile, optimizeOriginalVideofile, transcodeNewWebTorrentResolution } from '@server/lib/transcoding/web-transcoding'
-import { removeAllWebTorrentFiles } from '@server/lib/video-file'
+import { mergeAudioVideofile, optimizeOriginalVideofile, transcodeNewWebVideoResolution } from '@server/lib/transcoding/web-transcoding'
+import { removeAllWebVideoFiles } from '@server/lib/video-file'
 import { VideoPathManager } from '@server/lib/video-path-manager'
 import { moveToFailedTranscodingState } from '@server/lib/video-state'
 import { UserModel } from '@server/models/user/user'
@@ -11,7 +11,7 @@ import { MUser, MUserId, MVideoFullLight } from '@server/types/models'
 import {
   HLSTranscodingPayload,
   MergeAudioTranscodingPayload,
-  NewWebTorrentResolutionTranscodingPayload,
+  NewWebVideoResolutionTranscodingPayload,
   OptimizeTranscodingPayload,
   VideoTranscodingPayload
 } from '@shared/models'
@@ -22,9 +22,9 @@ type HandlerFunction = (job: Job, payload: VideoTranscodingPayload, video: MVide
 
 const handlers: { [ id in VideoTranscodingPayload['type'] ]: HandlerFunction } = {
   'new-resolution-to-hls': handleHLSJob,
-  'new-resolution-to-webtorrent': handleNewWebTorrentResolutionJob,
-  'merge-audio-to-webtorrent': handleWebTorrentMergeAudioJob,
-  'optimize-to-webtorrent': handleWebTorrentOptimizeJob
+  'new-resolution-to-web-video': handleNewWebVideoResolutionJob,
+  'merge-audio-to-web-video': handleWebVideoMergeAudioJob,
+  'optimize-to-web-video': handleWebVideoOptimizeJob
 }
 
 const lTags = loggerTagsFactory('transcoding')
@@ -74,7 +74,7 @@ export {
 // Job handlers
 // ---------------------------------------------------------------------------
 
-async function handleWebTorrentMergeAudioJob (job: Job, payload: MergeAudioTranscodingPayload, video: MVideoFullLight, user: MUserId) {
+async function handleWebVideoMergeAudioJob (job: Job, payload: MergeAudioTranscodingPayload, video: MVideoFullLight, user: MUserId) {
   logger.info('Handling merge audio transcoding job for %s.', video.uuid, lTags(video.uuid), { payload })
 
   await mergeAudioVideofile({ video, resolution: payload.resolution, fps: payload.fps, job })
@@ -84,7 +84,7 @@ async function handleWebTorrentMergeAudioJob (job: Job, payload: MergeAudioTrans
   await onTranscodingEnded({ isNewVideo: payload.isNewVideo, moveVideoToNextState: !payload.hasChildren, video })
 }
 
-async function handleWebTorrentOptimizeJob (job: Job, payload: OptimizeTranscodingPayload, video: MVideoFullLight, user: MUserId) {
+async function handleWebVideoOptimizeJob (job: Job, payload: OptimizeTranscodingPayload, video: MVideoFullLight, user: MUserId) {
   logger.info('Handling optimize transcoding job for %s.', video.uuid, lTags(video.uuid), { payload })
 
   await optimizeOriginalVideofile({ video, inputVideoFile: video.getMaxQualityFile(), quickTranscode: payload.quickTranscode, job })
@@ -96,12 +96,12 @@ async function handleWebTorrentOptimizeJob (job: Job, payload: OptimizeTranscodi
 
 // ---------------------------------------------------------------------------
 
-async function handleNewWebTorrentResolutionJob (job: Job, payload: NewWebTorrentResolutionTranscodingPayload, video: MVideoFullLight) {
-  logger.info('Handling WebTorrent transcoding job for %s.', video.uuid, lTags(video.uuid), { payload })
+async function handleNewWebVideoResolutionJob (job: Job, payload: NewWebVideoResolutionTranscodingPayload, video: MVideoFullLight) {
+  logger.info('Handling Web Video transcoding job for %s.', video.uuid, lTags(video.uuid), { payload })
 
-  await transcodeNewWebTorrentResolution({ video, resolution: payload.resolution, fps: payload.fps, job })
+  await transcodeNewWebVideoResolution({ video, resolution: payload.resolution, fps: payload.fps, job })
 
-  logger.info('WebTorrent transcoding job for %s ended.', video.uuid, lTags(video.uuid), { payload })
+  logger.info('Web Video transcoding job for %s ended.', video.uuid, lTags(video.uuid), { payload })
 
   await onTranscodingEnded({ isNewVideo: payload.isNewVideo, moveVideoToNextState: true, video })
 }
@@ -118,7 +118,7 @@ async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, videoArg:
     video = await VideoModel.loadFull(videoArg.uuid)
 
     const videoFileInput = payload.copyCodecs
-      ? video.getWebTorrentFile(payload.resolution)
+      ? video.getWebVideoFile(payload.resolution)
       : video.getMaxQualityFile()
 
     const videoOrStreamingPlaylist = videoFileInput.getVideoOrStreamingPlaylist()
@@ -140,10 +140,10 @@ async function handleHLSJob (job: Job, payload: HLSTranscodingPayload, videoArg:
 
   logger.info('HLS transcoding job for %s ended.', video.uuid, lTags(video.uuid), { payload })
 
-  if (payload.deleteWebTorrentFiles === true) {
-    logger.info('Removing WebTorrent files of %s now we have a HLS version of it.', video.uuid, lTags(video.uuid))
+  if (payload.deleteWebVideoFiles === true) {
+    logger.info('Removing Web Video files of %s now we have a HLS version of it.', video.uuid, lTags(video.uuid))
 
-    await removeAllWebTorrentFiles(video)
+    await removeAllWebVideoFiles(video)
   }
 
   await onTranscodingEnded({ isNewVideo: payload.isNewVideo, moveVideoToNextState: true, video })
index 4f17073f48afab4ef079ad0520b667bcd8ca2b88..6d2098298de024a9d9dd19836f2a46a84f152fd5 100644 (file)
@@ -9,12 +9,12 @@ function generateHLSObjectBaseStorageKey (playlist: MStreamingPlaylistVideo) {
   return join(playlist.getStringType(), playlist.Video.uuid)
 }
 
-function generateWebTorrentObjectStorageKey (filename: string) {
+function generateWebVideoObjectStorageKey (filename: string) {
   return filename
 }
 
 export {
   generateHLSObjectStorageKey,
   generateHLSObjectBaseStorageKey,
-  generateWebTorrentObjectStorageKey
+  generateWebVideoObjectStorageKey
 }
index d8473d01e39687827e26313d9a32012c9a338edc..313654a574d8a24cdcd867cdbb1fb99e42ee30e0 100644 (file)
@@ -2,9 +2,9 @@ import { GetObjectCommand } from '@aws-sdk/client-s3'
 import { getSignedUrl } from '@aws-sdk/s3-request-presigner'
 import { CONFIG } from '@server/initializers/config'
 import { MStreamingPlaylistVideo, MVideoFile } from '@server/types/models'
-import { generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys'
+import { generateHLSObjectStorageKey, generateWebVideoObjectStorageKey } from './keys'
 import { buildKey, getClient } from './shared'
-import { getHLSPublicFileUrl, getWebTorrentPublicFileUrl } from './urls'
+import { getHLSPublicFileUrl, getWebVideoPublicFileUrl } from './urls'
 
 export async function generateWebVideoPresignedUrl (options: {
   file: MVideoFile
@@ -12,7 +12,7 @@ export async function generateWebVideoPresignedUrl (options: {
 }) {
   const { file, downloadFilename } = options
 
-  const key = generateWebTorrentObjectStorageKey(file.filename)
+  const key = generateWebVideoObjectStorageKey(file.filename)
 
   const command = new GetObjectCommand({
     Bucket: CONFIG.OBJECT_STORAGE.VIDEOS.BUCKET_NAME,
@@ -22,7 +22,7 @@ export async function generateWebVideoPresignedUrl (options: {
 
   const url = await getSignedUrl(getClient(), command, { expiresIn: 3600 * 24 })
 
-  return getWebTorrentPublicFileUrl(url)
+  return getWebVideoPublicFileUrl(url)
 }
 
 export async function generateHLSFilePresignedUrl (options: {
index c782a8a25000e378aa20bc3b533fec98ff1f3e27..c09a0d1b07b3f53c1267d7f8930e952bc0c1bde4 100644 (file)
@@ -7,19 +7,19 @@ import { StreamReplacer } from '@server/helpers/stream-replacer'
 import { MStreamingPlaylist, MVideo } from '@server/types/models'
 import { HttpStatusCode } from '@shared/models'
 import { injectQueryToPlaylistUrls } from '../hls'
-import { getHLSFileReadStream, getWebTorrentFileReadStream } from './videos'
+import { getHLSFileReadStream, getWebVideoFileReadStream } from './videos'
 
-export async function proxifyWebTorrentFile (options: {
+export async function proxifyWebVideoFile (options: {
   req: express.Request
   res: express.Response
   filename: string
 }) {
   const { req, res, filename } = options
 
-  logger.debug('Proxifying WebTorrent file %s from object storage.', filename)
+  logger.debug('Proxifying Web Video file %s from object storage.', filename)
 
   try {
-    const { response: s3Response, stream } = await getWebTorrentFileReadStream({
+    const { response: s3Response, stream } = await getWebVideoFileReadStream({
       filename,
       rangeHeader: req.header('range')
     })
index b8ef94559a523c398657e938b55f2db8f1c7bf9a..84bc1f6c09f5155c4b9add3814dd23fe1a63ab35 100644 (file)
@@ -9,7 +9,7 @@ function getInternalUrl (config: BucketInfo, keyWithoutPrefix: string) {
 
 // ---------------------------------------------------------------------------
 
-function getWebTorrentPublicFileUrl (fileUrl: string) {
+function getWebVideoPublicFileUrl (fileUrl: string) {
   const baseUrl = CONFIG.OBJECT_STORAGE.VIDEOS.BASE_URL
   if (!baseUrl) return fileUrl
 
@@ -29,7 +29,7 @@ function getHLSPrivateFileUrl (video: MVideoUUID, filename: string) {
   return WEBSERVER.URL + OBJECT_STORAGE_PROXY_PATHS.STREAMING_PLAYLISTS.PRIVATE_HLS + video.uuid + `/${filename}`
 }
 
-function getWebTorrentPrivateFileUrl (filename: string) {
+function getWebVideoPrivateFileUrl (filename: string) {
   return WEBSERVER.URL + OBJECT_STORAGE_PROXY_PATHS.PRIVATE_WEBSEED + filename
 }
 
@@ -38,11 +38,11 @@ function getWebTorrentPrivateFileUrl (filename: string) {
 export {
   getInternalUrl,
 
-  getWebTorrentPublicFileUrl,
+  getWebVideoPublicFileUrl,
   getHLSPublicFileUrl,
 
   getHLSPrivateFileUrl,
-  getWebTorrentPrivateFileUrl,
+  getWebVideoPrivateFileUrl,
 
   replaceByBaseUrl
 }
index 9152c535295eb3108bb3a95d4e3eb65c81272d05..300c1f7e17051190055c1ecb1ec67274bbef6f58 100644 (file)
@@ -4,7 +4,7 @@ import { CONFIG } from '@server/initializers/config'
 import { MStreamingPlaylistVideo, MVideo, MVideoFile } from '@server/types/models'
 import { getHLSDirectory } from '../paths'
 import { VideoPathManager } from '../video-path-manager'
-import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys'
+import { generateHLSObjectBaseStorageKey, generateHLSObjectStorageKey, generateWebVideoObjectStorageKey } from './keys'
 import {
   createObjectReadStream,
   listKeysOfPrefix,
@@ -55,10 +55,10 @@ function storeHLSFileFromContent (playlist: MStreamingPlaylistVideo, path: strin
 
 // ---------------------------------------------------------------------------
 
-function storeWebTorrentFile (video: MVideo, file: MVideoFile) {
+function storeWebVideoFile (video: MVideo, file: MVideoFile) {
   return storeObject({
     inputPath: VideoPathManager.Instance.getFSVideoFileOutputPath(video, file),
-    objectStorageKey: generateWebTorrentObjectStorageKey(file.filename),
+    objectStorageKey: generateWebVideoObjectStorageKey(file.filename),
     bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS,
     isPrivate: video.hasPrivateStaticPath()
   })
@@ -66,9 +66,9 @@ function storeWebTorrentFile (video: MVideo, file: MVideoFile) {
 
 // ---------------------------------------------------------------------------
 
-async function updateWebTorrentFileACL (video: MVideo, file: MVideoFile) {
+async function updateWebVideoFileACL (video: MVideo, file: MVideoFile) {
   await updateObjectACL({
-    objectStorageKey: generateWebTorrentObjectStorageKey(file.filename),
+    objectStorageKey: generateWebVideoObjectStorageKey(file.filename),
     bucketInfo: CONFIG.OBJECT_STORAGE.VIDEOS,
     isPrivate: video.hasPrivateStaticPath()
   })
@@ -102,8 +102,8 @@ function removeHLSFileObjectStorageByFullKey (key: string) {
 
 // ---------------------------------------------------------------------------
 
-function removeWebTorrentObjectStorage (videoFile: MVideoFile) {
-  return removeObject(generateWebTorrentObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS)
+function removeWebVideoObjectStorage (videoFile: MVideoFile) {
+  return removeObject(generateWebVideoObjectStorageKey(videoFile.filename), CONFIG.OBJECT_STORAGE.VIDEOS)
 }
 
 // ---------------------------------------------------------------------------
@@ -122,10 +122,10 @@ async function makeHLSFileAvailable (playlist: MStreamingPlaylistVideo, filename
   return destination
 }
 
-async function makeWebTorrentFileAvailable (filename: string, destination: string) {
-  const key = generateWebTorrentObjectStorageKey(filename)
+async function makeWebVideoFileAvailable (filename: string, destination: string) {
+  const key = generateWebVideoObjectStorageKey(filename)
 
-  logger.info('Fetching WebTorrent file %s from object storage to %s.', key, destination, lTags())
+  logger.info('Fetching Web Video file %s from object storage to %s.', key, destination, lTags())
 
   await makeAvailable({
     key,
@@ -138,13 +138,13 @@ async function makeWebTorrentFileAvailable (filename: string, destination: strin
 
 // ---------------------------------------------------------------------------
 
-function getWebTorrentFileReadStream (options: {
+function getWebVideoFileReadStream (options: {
   filename: string
   rangeHeader: string
 }) {
   const { filename, rangeHeader } = options
 
-  const key = generateWebTorrentObjectStorageKey(filename)
+  const key = generateWebVideoObjectStorageKey(filename)
 
   return createObjectReadStream({
     key,
@@ -174,12 +174,12 @@ function getHLSFileReadStream (options: {
 export {
   listHLSFileKeysOf,
 
-  storeWebTorrentFile,
+  storeWebVideoFile,
   storeHLSFileFromFilename,
   storeHLSFileFromPath,
   storeHLSFileFromContent,
 
-  updateWebTorrentFileACL,
+  updateWebVideoFileACL,
   updateHLSFilesACL,
 
   removeHLSObjectStorage,
@@ -187,11 +187,11 @@ export {
   removeHLSFileObjectStorageByPath,
   removeHLSFileObjectStorageByFullKey,
 
-  removeWebTorrentObjectStorage,
+  removeWebVideoObjectStorage,
 
-  makeWebTorrentFileAvailable,
+  makeWebVideoFileAvailable,
   makeHLSFileAvailable,
 
-  getWebTorrentFileReadStream,
+  getWebVideoFileReadStream,
   getHLSFileReadStream
 }
index 470970f55f2b41777781c50c5bb9702690c26d70..db1cdede2daffbeb4f7b5d0e04d7ce02209e1d2e 100644 (file)
@@ -8,7 +8,7 @@ import { isVideoInPrivateDirectory } from './video-privacy'
 
 // ################## Video file name ##################
 
-function generateWebTorrentVideoFilename (resolution: number, extname: string) {
+function generateWebVideoFilename (resolution: number, extname: string) {
   return buildUUID() + '-' + resolution + extname
 }
 
@@ -76,7 +76,7 @@ function getFSTorrentFilePath (videoFile: MVideoFile) {
 
 export {
   generateHLSVideoFilename,
-  generateWebTorrentVideoFilename,
+  generateWebVideoFilename,
 
   generateTorrentFileName,
   getFSTorrentFilePath,
index d235f52c08c07dfd29eb740c81119fbb5637b60a..b4e3eece48f20bd9ed26ece56c90f19ed6a94a9a 100644 (file)
@@ -104,7 +104,7 @@ function buildVideosHelpers () {
       const video = await VideoModel.loadFull(id)
       if (!video) return undefined
 
-      const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({
+      const webVideoFiles = (video.VideoFiles || []).map(f => ({
         path: f.storage === VideoStorage.FILE_SYSTEM
           ? VideoPathManager.Instance.getFSVideoFileOutputPath(video, f)
           : null,
@@ -138,8 +138,12 @@ function buildVideosHelpers () {
       }))
 
       return {
-        webtorrent: {
-          videoFiles: webtorrentVideoFiles
+        webtorrent: { // TODO: remove in v7
+          videoFiles: webVideoFiles
+        },
+
+        webVideo: {
+          videoFiles: webVideoFiles
         },
 
         hls: {
index 93ae89ff87c7bcd08c9f509bd0c1d24ef8601c23..1a2ad02ca0bbee9f8832eea755953056428ce1a9 100644 (file)
@@ -2,7 +2,7 @@ import { move } from 'fs-extra'
 import { dirname, join } from 'path'
 import { logger, LoggerTagsFn } from '@server/helpers/logger'
 import { onTranscodingEnded } from '@server/lib/transcoding/ended-transcoding'
-import { onWebTorrentVideoFileTranscoding } from '@server/lib/transcoding/web-transcoding'
+import { onWebVideoFileTranscoding } from '@server/lib/transcoding/web-transcoding'
 import { buildNewFile } from '@server/lib/video-file'
 import { VideoModel } from '@server/models/video/video'
 import { MVideoFullLight } from '@server/types/models'
@@ -22,7 +22,7 @@ export async function onVODWebVideoOrAudioMergeTranscodingJob (options: {
   const newVideoFilePath = join(dirname(videoFilePath), videoFile.filename)
   await move(videoFilePath, newVideoFilePath)
 
-  await onWebTorrentVideoFileTranscoding({
+  await onWebVideoFileTranscoding({
     video,
     videoFile,
     videoOutputPath: newVideoFilePath
index 5f247d7929db87b08b29e307c61502955ff05e75..905007db930c29e5e3a7ad2279bb3e369d0ea0f4 100644 (file)
@@ -83,7 +83,7 @@ export class VODAudioMergeTranscodingJobHandler extends AbstractVODTranscodingJo
 
     // We can remove the old audio file
     const oldAudioFile = video.VideoFiles[0]
-    await video.removeWebTorrentFile(oldAudioFile)
+    await video.removeWebVideoFile(oldAudioFile)
     await oldAudioFile.destroy()
     video.VideoFiles = []
 
index cc94bcbda072da9583541911e85a7a030a210bfb..02845952cbd54e834a1ec9c35c2916554e1f1b52 100644 (file)
@@ -5,7 +5,7 @@ import { renameVideoFileInPlaylist } from '@server/lib/hls'
 import { getHlsResolutionPlaylistFilename } from '@server/lib/paths'
 import { onTranscodingEnded } from '@server/lib/transcoding/ended-transcoding'
 import { onHLSVideoFileTranscoding } from '@server/lib/transcoding/hls-transcoding'
-import { buildNewFile, removeAllWebTorrentFiles } from '@server/lib/video-file'
+import { buildNewFile, removeAllWebVideoFiles } from '@server/lib/video-file'
 import { VideoJobInfoModel } from '@server/models/video/video-job-info'
 import { MVideo } from '@server/types/models'
 import { MRunnerJob } from '@server/types/models/runners'
@@ -106,7 +106,7 @@ export class VODHLSTranscodingJobHandler extends AbstractVODTranscodingJobHandle
     if (privatePayload.deleteWebVideoFiles === true) {
       logger.info('Removing web video files of %s now we have a HLS version of it.', video.uuid, this.lTags(video.uuid))
 
-      await removeAllWebTorrentFiles(video)
+      await removeAllWebVideoFiles(video)
     }
 
     logger.info('Runner VOD HLS job %s for %s ended.', runnerJob.uuid, video.uuid, this.lTags(runnerJob.uuid, video.uuid))
index dc450c338d19d4812e10ff99a83bbea161cb36a8..24d340a7344781265e3ef42c73fa719c3a00d98b 100644 (file)
@@ -23,7 +23,7 @@ import { getLocalVideoCacheFileActivityPubUrl, getLocalVideoCacheStreamingPlayli
 import { getOrCreateAPVideo } from '../activitypub/videos'
 import { downloadPlaylistSegments } from '../hls'
 import { removeVideoRedundancy } from '../redundancy'
-import { generateHLSRedundancyUrl, generateWebTorrentRedundancyUrl } from '../video-urls'
+import { generateHLSRedundancyUrl, generateWebVideoRedundancyUrl } from '../video-urls'
 import { AbstractScheduler } from './abstract-scheduler'
 
 const lTags = loggerTagsFactory('redundancy')
@@ -244,7 +244,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler {
     const createdModel: MVideoRedundancyFileVideo = await VideoRedundancyModel.create({
       expiresOn,
       url: getLocalVideoCacheFileActivityPubUrl(file),
-      fileUrl: generateWebTorrentRedundancyUrl(file),
+      fileUrl: generateWebVideoRedundancyUrl(file),
       strategy,
       videoFileId: file.id,
       actorId: serverActor.id
index abe32684de7f8f10d6b4ac6a3288b497a91efed1..d78e68b8734e45cfff0de5bdd57359582f3d687e 100644 (file)
@@ -15,7 +15,7 @@ export function createOptimizeOrMergeAudioJobs (options: {
 // ---------------------------------------------------------------------------
 
 export function createTranscodingJobs (options: {
-  transcodingType: 'hls' | 'webtorrent'
+  transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
   video: MVideoFullLight
   resolutions: number[]
   isNewVideo: boolean
index 80dc05bfb62c7575400cc2b2bcd314659863c34e..15fc814ae3a0a2ec06f0b3c5b0cdb2369ca4aefe 100644 (file)
@@ -12,7 +12,7 @@ export abstract class AbstractJobBuilder {
   }): Promise<any>
 
   abstract createTranscodingJobs (options: {
-    transcodingType: 'hls' | 'webtorrent'
+    transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
     video: MVideoFullLight
     resolutions: number[]
     isNewVideo: boolean
index 4f802e2a67e947d6b535eedcdceb45729ad46ccf..2ecd57249dee7b5eb66d9587297191815412cd17 100644 (file)
@@ -12,7 +12,7 @@ import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, hasAud
 import {
   HLSTranscodingPayload,
   MergeAudioTranscodingPayload,
-  NewWebTorrentResolutionTranscodingPayload,
+  NewWebVideoResolutionTranscodingPayload,
   OptimizeTranscodingPayload,
   VideoTranscodingPayload
 } from '@shared/models'
@@ -33,7 +33,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
     const { video, videoFile, isNewVideo, user, videoFileAlreadyLocked } = options
 
     let mergeOrOptimizePayload: MergeAudioTranscodingPayload | OptimizeTranscodingPayload
-    let nextTranscodingSequentialJobPayloads: (NewWebTorrentResolutionTranscodingPayload | HLSTranscodingPayload)[][] = []
+    let nextTranscodingSequentialJobPayloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[][] = []
 
     const mutexReleaser = videoFileAlreadyLocked
       ? () => {}
@@ -60,7 +60,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
         if (CONFIG.TRANSCODING.HLS.ENABLED === true) {
           nextTranscodingSequentialJobPayloads.push([
             this.buildHLSJobPayload({
-              deleteWebTorrentFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false,
+              deleteWebVideoFiles: CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false,
 
               // We had some issues with a web video quick transcoded while producing a HLS version of it
               copyCodecs: !quickTranscode,
@@ -116,7 +116,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
   // ---------------------------------------------------------------------------
 
   async createTranscodingJobs (options: {
-    transcodingType: 'hls' | 'webtorrent'
+    transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
     video: MVideoFullLight
     resolutions: number[]
     isNewVideo: boolean
@@ -138,8 +138,8 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
         return this.buildHLSJobPayload({ videoUUID: video.uuid, resolution, fps, isNewVideo })
       }
 
-      if (transcodingType === 'webtorrent') {
-        return this.buildWebTorrentJobPayload({ videoUUID: video.uuid, resolution, fps, isNewVideo })
+      if (transcodingType === 'webtorrent' || transcodingType === 'web-video') {
+        return this.buildWebVideoJobPayload({ videoUUID: video.uuid, resolution, fps, isNewVideo })
       }
 
       throw new Error('Unknown transcoding type')
@@ -149,7 +149,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
 
     const parent = transcodingType === 'hls'
       ? this.buildHLSJobPayload({ videoUUID: video.uuid, resolution: maxResolution, fps, isNewVideo })
-      : this.buildWebTorrentJobPayload({ videoUUID: video.uuid, resolution: maxResolution, fps, isNewVideo })
+      : this.buildWebVideoJobPayload({ videoUUID: video.uuid, resolution: maxResolution, fps, isNewVideo })
 
     // Process the last resolution after the other ones to prevent concurrency issue
     // Because low resolutions use the biggest one as ffmpeg input
@@ -160,8 +160,8 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
 
   private async createTranscodingJobsWithChildren (options: {
     videoUUID: string
-    parent: (HLSTranscodingPayload | NewWebTorrentResolutionTranscodingPayload)
-    children: (HLSTranscodingPayload | NewWebTorrentResolutionTranscodingPayload)[]
+    parent: (HLSTranscodingPayload | NewWebVideoResolutionTranscodingPayload)
+    children: (HLSTranscodingPayload | NewWebVideoResolutionTranscodingPayload)[]
     user: MUserId | null
   }) {
     const { videoUUID, parent, children, user } = options
@@ -203,14 +203,14 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
       options
     )
 
-    const sequentialPayloads: (NewWebTorrentResolutionTranscodingPayload | HLSTranscodingPayload)[][] = []
+    const sequentialPayloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[][] = []
 
     for (const resolution of resolutionsEnabled) {
       const fps = computeOutputFPS({ inputFPS: inputVideoFPS, resolution })
 
       if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED) {
-        const payloads: (NewWebTorrentResolutionTranscodingPayload | HLSTranscodingPayload)[] = [
-          this.buildWebTorrentJobPayload({
+        const payloads: (NewWebVideoResolutionTranscodingPayload | HLSTranscodingPayload)[] = [
+          this.buildWebVideoJobPayload({
             videoUUID: video.uuid,
             resolution,
             fps,
@@ -253,10 +253,10 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
     resolution: number
     fps: number
     isNewVideo: boolean
-    deleteWebTorrentFiles?: boolean // default false
+    deleteWebVideoFiles?: boolean // default false
     copyCodecs?: boolean // default false
   }): HLSTranscodingPayload {
-    const { videoUUID, resolution, fps, isNewVideo, deleteWebTorrentFiles = false, copyCodecs = false } = options
+    const { videoUUID, resolution, fps, isNewVideo, deleteWebVideoFiles = false, copyCodecs = false } = options
 
     return {
       type: 'new-resolution-to-hls',
@@ -265,20 +265,20 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
       fps,
       copyCodecs,
       isNewVideo,
-      deleteWebTorrentFiles
+      deleteWebVideoFiles
     }
   }
 
-  private buildWebTorrentJobPayload (options: {
+  private buildWebVideoJobPayload (options: {
     videoUUID: string
     resolution: number
     fps: number
     isNewVideo: boolean
-  }): NewWebTorrentResolutionTranscodingPayload {
+  }): NewWebVideoResolutionTranscodingPayload {
     const { videoUUID, resolution, fps, isNewVideo } = options
 
     return {
-      type: 'new-resolution-to-webtorrent',
+      type: 'new-resolution-to-web-video',
       videoUUID,
       isNewVideo,
       resolution,
@@ -294,7 +294,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
     const { videoUUID, isNewVideo, hasChildren } = options
 
     return {
-      type: 'merge-audio-to-webtorrent',
+      type: 'merge-audio-to-web-video',
       resolution: DEFAULT_AUDIO_RESOLUTION,
       fps: VIDEO_TRANSCODING_FPS.AUDIO_MERGE,
       videoUUID,
@@ -312,7 +312,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {
     const { videoUUID, quickTranscode, isNewVideo, hasChildren } = options
 
     return {
-      type: 'optimize-to-webtorrent',
+      type: 'optimize-to-web-video',
       videoUUID,
       isNewVideo,
       hasChildren,
index 4b8bc2f3de92ca46e47678e094e73e759db983e6..b98172c2dfadc0ade87f4db6a63fcda65529ecd9 100644 (file)
@@ -89,7 +89,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
   // ---------------------------------------------------------------------------
 
   async createTranscodingJobs (options: {
-    transcodingType: 'hls' | 'webtorrent'
+    transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
     video: MVideoFullLight
     resolutions: number[]
     isNewVideo: boolean
@@ -130,7 +130,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {
         continue
       }
 
-      if (transcodingType === 'webtorrent') {
+      if (transcodingType === 'webtorrent' || transcodingType === 'web-video') {
         await new VODWebVideoTranscodingJobHandler().create({
           video,
           resolution,
index a499db422a5a8be6af4e109fe1a6eb0861702707..f92d457a0984dd9e68f590008a2b956a6f676fb4 100644 (file)
@@ -10,7 +10,7 @@ import { VideoResolution, VideoStorage } from '@shared/models'
 import { CONFIG } from '../../initializers/config'
 import { VideoFileModel } from '../../models/video/video-file'
 import { JobQueue } from '../job-queue'
-import { generateWebTorrentVideoFilename } from '../paths'
+import { generateWebVideoFilename } from '../paths'
 import { buildFileMetadata } from '../video-file'
 import { VideoPathManager } from '../video-path-manager'
 import { buildFFmpegVOD } from './shared'
@@ -63,10 +63,10 @@ export async function optimizeOriginalVideofile (options: {
       // Important to do this before getVideoFilename() to take in account the new filename
       inputVideoFile.resolution = resolution
       inputVideoFile.extname = newExtname
-      inputVideoFile.filename = generateWebTorrentVideoFilename(resolution, newExtname)
+      inputVideoFile.filename = generateWebVideoFilename(resolution, newExtname)
       inputVideoFile.storage = VideoStorage.FILE_SYSTEM
 
-      const { videoFile } = await onWebTorrentVideoFileTranscoding({
+      const { videoFile } = await onWebVideoFileTranscoding({
         video,
         videoFile: inputVideoFile,
         videoOutputPath
@@ -83,8 +83,8 @@ export async function optimizeOriginalVideofile (options: {
   }
 }
 
-// Transcode the original video file to a lower resolution compatible with WebTorrent
-export async function transcodeNewWebTorrentResolution (options: {
+// Transcode the original video file to a lower resolution compatible with web browsers
+export async function transcodeNewWebVideoResolution (options: {
   video: MVideoFullLight
   resolution: VideoResolution
   fps: number
@@ -105,7 +105,7 @@ export async function transcodeNewWebTorrentResolution (options: {
       const newVideoFile = new VideoFileModel({
         resolution,
         extname: newExtname,
-        filename: generateWebTorrentVideoFilename(resolution, newExtname),
+        filename: generateWebVideoFilename(resolution, newExtname),
         size: 0,
         videoId: video.id
       })
@@ -126,7 +126,7 @@ export async function transcodeNewWebTorrentResolution (options: {
 
       await buildFFmpegVOD(job).transcode(transcodeOptions)
 
-      return onWebTorrentVideoFileTranscoding({ video, videoFile: newVideoFile, videoOutputPath })
+      return onWebVideoFileTranscoding({ video, videoFile: newVideoFile, videoOutputPath })
     })
 
     return result
@@ -189,14 +189,14 @@ export async function mergeAudioVideofile (options: {
       // Important to do this before getVideoFilename() to take in account the new file extension
       inputVideoFile.extname = newExtname
       inputVideoFile.resolution = resolution
-      inputVideoFile.filename = generateWebTorrentVideoFilename(inputVideoFile.resolution, newExtname)
+      inputVideoFile.filename = generateWebVideoFilename(inputVideoFile.resolution, newExtname)
 
       // ffmpeg generated a new video file, so update the video duration
       // See https://trac.ffmpeg.org/ticket/5456
       video.duration = await getVideoStreamDuration(videoOutputPath)
       await video.save()
 
-      return onWebTorrentVideoFileTranscoding({
+      return onWebVideoFileTranscoding({
         video,
         videoFile: inputVideoFile,
         videoOutputPath,
@@ -210,7 +210,7 @@ export async function mergeAudioVideofile (options: {
   }
 }
 
-export async function onWebTorrentVideoFileTranscoding (options: {
+export async function onWebVideoFileTranscoding (options: {
   video: MVideoFullLight
   videoFile: MVideoFile
   videoOutputPath: string
@@ -239,8 +239,8 @@ export async function onWebTorrentVideoFileTranscoding (options: {
 
     await createTorrentAndSetInfoHash(video, videoFile)
 
-    const oldFile = await VideoFileModel.loadWebTorrentFile({ videoId: video.id, fps: videoFile.fps, resolution: videoFile.resolution })
-    if (oldFile) await video.removeWebTorrentFile(oldFile)
+    const oldFile = await VideoFileModel.loadWebVideoFile({ videoId: video.id, fps: videoFile.fps, resolution: videoFile.resolution })
+    if (oldFile) await video.removeWebVideoFile(oldFile)
 
     await VideoFileModel.customUpsert(videoFile, 'video', undefined)
     video.VideoFiles = await video.$get('VideoFiles')
index 88d48c945d3c7bcc8d329709dd6d2f729fdb1054..46af67ccd39a17499d166e51787b90bb3f5f5a40 100644 (file)
@@ -7,7 +7,7 @@ import { getFileSize } from '@shared/extra-utils'
 import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, isAudioFile } from '@shared/ffmpeg'
 import { VideoFileMetadata, VideoResolution } from '@shared/models'
 import { lTags } from './object-storage/shared'
-import { generateHLSVideoFilename, generateWebTorrentVideoFilename } from './paths'
+import { generateHLSVideoFilename, generateWebVideoFilename } from './paths'
 import { VideoPathManager } from './video-path-manager'
 
 async function buildNewFile (options: {
@@ -33,7 +33,7 @@ async function buildNewFile (options: {
   }
 
   videoFile.filename = mode === 'web-video'
-    ? generateWebTorrentVideoFilename(videoFile.resolution, videoFile.extname)
+    ? generateWebVideoFilename(videoFile.resolution, videoFile.extname)
     : generateHLSVideoFilename(videoFile.resolution)
 
   return videoFile
@@ -85,12 +85,12 @@ async function removeHLSFile (video: MVideoWithAllFiles, fileToDeleteId: number)
 
 // ---------------------------------------------------------------------------
 
-async function removeAllWebTorrentFiles (video: MVideoWithAllFiles) {
+async function removeAllWebVideoFiles (video: MVideoWithAllFiles) {
   const videoFileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
 
   try {
     for (const file of video.VideoFiles) {
-      await video.removeWebTorrentFile(file)
+      await video.removeWebVideoFile(file)
       await file.destroy()
     }
 
@@ -102,17 +102,17 @@ async function removeAllWebTorrentFiles (video: MVideoWithAllFiles) {
   return video
 }
 
-async function removeWebTorrentFile (video: MVideoWithAllFiles, fileToDeleteId: number) {
+async function removeWebVideoFile (video: MVideoWithAllFiles, fileToDeleteId: number) {
   const files = video.VideoFiles
 
   if (files.length === 1) {
-    return removeAllWebTorrentFiles(video)
+    return removeAllWebVideoFiles(video)
   }
 
   const videoFileMutexReleaser = await VideoPathManager.Instance.lockFiles(video.uuid)
   try {
     const toDelete = files.find(f => f.id === fileToDeleteId)
-    await video.removeWebTorrentFile(toDelete)
+    await video.removeWebVideoFile(toDelete)
     await toDelete.destroy()
 
     video.VideoFiles = files.filter(f => f.id !== toDelete.id)
@@ -138,8 +138,8 @@ export {
 
   removeHLSPlaylist,
   removeHLSFile,
-  removeAllWebTorrentFiles,
-  removeWebTorrentFile,
+  removeAllWebVideoFiles,
+  removeWebVideoFile,
 
   buildFileMetadata
 }
index 9953cae5de2b99a772904c66770cb0a93e215b04..133544bb2298b903bec57178703249ddd43b6a24 100644 (file)
@@ -8,7 +8,7 @@ import { DIRECTORIES } from '@server/initializers/constants'
 import { MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoFileStreamingPlaylistVideo, MVideoFileVideo } from '@server/types/models'
 import { buildUUID } from '@shared/extra-utils'
 import { VideoStorage } from '@shared/models'
-import { makeHLSFileAvailable, makeWebTorrentFileAvailable } from './object-storage'
+import { makeHLSFileAvailable, makeWebVideoFileAvailable } from './object-storage'
 import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from './paths'
 import { isVideoInPrivateDirectory } from './video-privacy'
 
@@ -78,7 +78,7 @@ class VideoPathManager {
     }
 
     return this.makeAvailableFactory(
-      () => makeWebTorrentFileAvailable(videoFile.filename, destination),
+      () => makeWebVideoFileAvailable(videoFile.filename, destination),
       true,
       cb
     )
index 39430ef1e796c3703175b340808105e464ab53d4..5dd4d9781eea956f6ad358bec73ca4edc1e0614a 100644 (file)
@@ -4,7 +4,7 @@ import { logger } from '@server/helpers/logger'
 import { DIRECTORIES } from '@server/initializers/constants'
 import { MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
 import { VideoPrivacy, VideoStorage } from '@shared/models'
-import { updateHLSFilesACL, updateWebTorrentFileACL } from './object-storage'
+import { updateHLSFilesACL, updateWebVideoFileACL } from './object-storage'
 
 const validPrivacySet = new Set([
   VideoPrivacy.PRIVATE,
@@ -67,9 +67,9 @@ async function moveFiles (options: {
 
   for (const file of video.VideoFiles) {
     if (file.storage === VideoStorage.FILE_SYSTEM) {
-      await moveWebTorrentFileOnFS(type, video, file)
+      await moveWebVideoFileOnFS(type, video, file)
     } else {
-      await updateWebTorrentFileACL(video, file)
+      await updateWebVideoFileACL(video, file)
     }
   }
 
@@ -84,22 +84,22 @@ async function moveFiles (options: {
   }
 }
 
-async function moveWebTorrentFileOnFS (type: MoveType, video: MVideo, file: MVideoFile) {
-  const directories = getWebTorrentDirectories(type)
+async function moveWebVideoFileOnFS (type: MoveType, video: MVideo, file: MVideoFile) {
+  const directories = getWebVideoDirectories(type)
 
   const source = join(directories.old, file.filename)
   const destination = join(directories.new, file.filename)
 
   try {
-    logger.info('Moving WebTorrent files of %s after privacy change (%s -> %s).', video.uuid, source, destination)
+    logger.info('Moving web video files of %s after privacy change (%s -> %s).', video.uuid, source, destination)
 
     await move(source, destination)
   } catch (err) {
-    logger.error('Cannot move webtorrent file %s to %s after privacy change', source, destination, { err })
+    logger.error('Cannot move web video file %s to %s after privacy change', source, destination, { err })
   }
 }
 
-function getWebTorrentDirectories (moveType: MoveType) {
+function getWebVideoDirectories (moveType: MoveType) {
   if (moveType === 'private-to-public') {
     return { old: DIRECTORIES.VIDEOS.PRIVATE, new: DIRECTORIES.VIDEOS.PUBLIC }
   }
index 0d3db8f60df884a0a25df35fcd7599b61d544aaf..f549a7084313db45a6084b5126b22ff591d98fb9 100644 (file)
@@ -12,7 +12,7 @@ import { JobQueue } from './job-queue'
 import { VideoStudioTranscodingJobHandler } from './runners'
 import { createOptimizeOrMergeAudioJobs } from './transcoding/create-transcoding-job'
 import { getTranscodingJobPriority } from './transcoding/transcoding-priority'
-import { buildNewFile, removeHLSPlaylist, removeWebTorrentFile } from './video-file'
+import { buildNewFile, removeHLSPlaylist, removeWebVideoFile } from './video-file'
 import { VideoPathManager } from './video-path-manager'
 
 const lTags = loggerTagsFactory('video-studio')
@@ -119,12 +119,12 @@ export async function onVideoStudioEnded (options: {
 // Private
 // ---------------------------------------------------------------------------
 
-async function removeAllFiles (video: MVideoWithAllFiles, webTorrentFileException: MVideoFile) {
+async function removeAllFiles (video: MVideoWithAllFiles, webVideoFileException: MVideoFile) {
   await removeHLSPlaylist(video)
 
   for (const file of video.VideoFiles) {
-    if (file.id === webTorrentFileException.id) continue
+    if (file.id === webVideoFileException.id) continue
 
-    await removeWebTorrentFile(video, file.id)
+    await removeWebVideoFile(video, file.id)
   }
 }
index 64c2c9bf94a0d92dbd34aa150fbdfe82c8f415c3..0597488ad4ad684a15bea5d5d87a9a0a18499b0f 100644 (file)
@@ -9,7 +9,7 @@ function generateHLSRedundancyUrl (video: MVideo, playlist: MStreamingPlaylist)
   return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + playlist.getStringType() + '/' + video.uuid
 }
 
-function generateWebTorrentRedundancyUrl (file: MVideoFile) {
+function generateWebVideoRedundancyUrl (file: MVideoFile) {
   return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + file.filename
 }
 
@@ -26,6 +26,6 @@ function getLocalVideoFileMetadataUrl (video: MVideoUUID, videoFile: MVideoFile)
 export {
   getLocalVideoFileMetadataUrl,
 
-  generateWebTorrentRedundancyUrl,
+  generateWebVideoRedundancyUrl,
   generateHLSRedundancyUrl
 }
index 36a94080c7191b8f68785891f5c396d024a1e271..86cc0a8d70b7fa25642a77d0ebff60c73f64637f 100644 (file)
@@ -22,7 +22,7 @@ const staticFileTokenBypass = new LRUCache<string, LRUValue>({
   ttl: LRU_CACHE.STATIC_VIDEO_FILES_RIGHTS_CHECK.TTL
 })
 
-const ensureCanAccessVideoPrivateWebTorrentFiles = [
+const ensureCanAccessVideoPrivateWebVideoFiles = [
   query('videoFileToken').optional().custom(exists),
 
   isValidVideoPasswordHeader(),
@@ -48,7 +48,7 @@ const ensureCanAccessVideoPrivateWebTorrentFiles = [
       return res.sendStatus(HttpStatusCode.FORBIDDEN_403)
     }
 
-    const result = await isWebTorrentAllowed(req, res)
+    const result = await isWebVideoAllowed(req, res)
 
     staticFileTokenBypass.set(cacheKey, result)
 
@@ -122,13 +122,13 @@ const ensureCanAccessPrivateVideoHLSFiles = [
 ]
 
 export {
-  ensureCanAccessVideoPrivateWebTorrentFiles,
+  ensureCanAccessVideoPrivateWebVideoFiles,
   ensureCanAccessPrivateVideoHLSFiles
 }
 
 // ---------------------------------------------------------------------------
 
-async function isWebTorrentAllowed (req: express.Request, res: express.Response) {
+async function isWebVideoAllowed (req: express.Request, res: express.Response) {
   const filename = basename(req.path)
 
   const file = await VideoFileModel.loadWithVideoByFilename(filename)
index 92c5b9483b9d1ef6e5f8d9dec370ea0eb1257e3c..6c0ecda42833e5e5d1ef94a59714bad6bcea9d04 100644 (file)
@@ -5,7 +5,7 @@ import { MVideo } from '@server/types/models'
 import { HttpStatusCode } from '@shared/models'
 import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared'
 
-const videoFilesDeleteWebTorrentValidator = [
+const videoFilesDeleteWebVideoValidator = [
   isValidVideoIdParam('id'),
 
   async (req: express.Request, res: express.Response, next: express.NextFunction) => {
@@ -16,17 +16,17 @@ const videoFilesDeleteWebTorrentValidator = [
 
     if (!checkLocalVideo(video, res)) return
 
-    if (!video.hasWebTorrentFiles()) {
+    if (!video.hasWebVideoFiles()) {
       return res.fail({
         status: HttpStatusCode.BAD_REQUEST_400,
-        message: 'This video does not have WebTorrent files'
+        message: 'This video does not have Web Video files'
       })
     }
 
     if (!video.getHLSPlaylist()) {
       return res.fail({
         status: HttpStatusCode.BAD_REQUEST_400,
-        message: 'Cannot delete WebTorrent files since this video does not have HLS playlist'
+        message: 'Cannot delete Web Video files since this video does not have HLS playlist'
       })
     }
 
@@ -34,7 +34,7 @@ const videoFilesDeleteWebTorrentValidator = [
   }
 ]
 
-const videoFilesDeleteWebTorrentFileValidator = [
+const videoFilesDeleteWebVideoFileValidator = [
   isValidVideoIdParam('id'),
 
   param('videoFileId')
@@ -52,14 +52,14 @@ const videoFilesDeleteWebTorrentFileValidator = [
     if (!files.find(f => f.id === +req.params.videoFileId)) {
       return res.fail({
         status: HttpStatusCode.NOT_FOUND_404,
-        message: 'This video does not have this WebTorrent file id'
+        message: 'This video does not have this Web Video file id'
       })
     }
 
     if (files.length === 1 && !video.getHLSPlaylist()) {
       return res.fail({
         status: HttpStatusCode.BAD_REQUEST_400,
-        message: 'Cannot delete WebTorrent files since this video does not have HLS playlist'
+        message: 'Cannot delete Web Video files since this video does not have HLS playlist'
       })
     }
 
@@ -87,10 +87,10 @@ const videoFilesDeleteHLSValidator = [
       })
     }
 
-    if (!video.hasWebTorrentFiles()) {
+    if (!video.hasWebVideoFiles()) {
       return res.fail({
         status: HttpStatusCode.BAD_REQUEST_400,
-        message: 'Cannot delete HLS playlist since this video does not have WebTorrent files'
+        message: 'Cannot delete HLS playlist since this video does not have Web Video files'
       })
     }
 
@@ -128,10 +128,10 @@ const videoFilesDeleteHLSFileValidator = [
     }
 
     // Last file to delete
-    if (hlsFiles.length === 1 && !video.hasWebTorrentFiles()) {
+    if (hlsFiles.length === 1 && !video.hasWebVideoFiles()) {
       return res.fail({
         status: HttpStatusCode.BAD_REQUEST_400,
-        message: 'Cannot delete last HLS playlist file since this video does not have WebTorrent files'
+        message: 'Cannot delete last HLS playlist file since this video does not have Web Video files'
       })
     }
 
@@ -140,8 +140,8 @@ const videoFilesDeleteHLSFileValidator = [
 ]
 
 export {
-  videoFilesDeleteWebTorrentValidator,
-  videoFilesDeleteWebTorrentFileValidator,
+  videoFilesDeleteWebVideoValidator,
+  videoFilesDeleteWebVideoFileValidator,
 
   videoFilesDeleteHLSValidator,
   videoFilesDeleteHLSFileValidator
index b829e4eb4e667cc7e4ce067c751f51816eda1645..b39d13a23231f63118afb64f082d4da8913ad3c9 100644 (file)
@@ -506,10 +506,14 @@ const commonVideosFiltersValidator = [
     .optional()
     .customSanitizer(toBooleanOrNull)
     .custom(isBooleanValid).withMessage('Should have a valid hasHLSFiles boolean'),
-  query('hasWebtorrentFiles')
+  query('hasWebtorrentFiles') // TODO: remove in v7
     .optional()
     .customSanitizer(toBooleanOrNull)
     .custom(isBooleanValid).withMessage('Should have a valid hasWebtorrentFiles boolean'),
+  query('hasWebVideoFiles')
+    .optional()
+    .customSanitizer(toBooleanOrNull)
+    .custom(isBooleanValid).withMessage('Should have a valid hasWebVideoFiles boolean'),
   query('skipCount')
     .optional()
     .customSanitizer(toBooleanOrNull)
index c2a72b71f42d554bae801ca1e106f88a741d2bd8..cebf47dfd9542254b7b6631bfae90568f55413a9 100644 (file)
@@ -162,7 +162,7 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoRedu
       const logIdentifier = `${videoFile.Video.uuid}-${videoFile.resolution}`
       logger.info('Removing duplicated video file %s.', logIdentifier)
 
-      videoFile.Video.removeWebTorrentFile(videoFile, true)
+      videoFile.Video.removeWebVideoFile(videoFile, true)
         .catch(err => logger.error('Cannot delete %s files.', logIdentifier, { err }))
     }
 
index 4f6a8fce442ad64340ca101e296a1f80cd1543fd..ff6328d48382d2f0715a5d5687545bdc658cbc86 100644 (file)
@@ -786,7 +786,7 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
       'INNER JOIN "account" ON "videoChannel"."accountId" = "account"."id" ' +
       `WHERE "account"."userId" = ${options.whereUserId} ${andWhere}`
 
-    const webtorrentFiles = 'SELECT "videoFile"."size" AS "size", "video"."id" AS "videoId" FROM "videoFile" ' +
+    const webVideoFiles = 'SELECT "videoFile"."size" AS "size", "video"."id" AS "videoId" FROM "videoFile" ' +
       'INNER JOIN "video" ON "videoFile"."videoId" = "video"."id" AND "video"."isLive" IS FALSE ' +
       videoChannelJoin
 
@@ -797,7 +797,7 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
 
     return 'SELECT COALESCE(SUM("size"), 0) AS "total" ' +
       'FROM (' +
-        `SELECT MAX("t1"."size") AS "size" FROM (${webtorrentFiles} UNION ${hlsFiles}) t1 ` +
+        `SELECT MAX("t1"."size") AS "size" FROM (${webVideoFiles} UNION ${hlsFiles}) t1 ` +
         'GROUP BY "t1"."videoId"' +
       ') t2'
   }
@@ -890,8 +890,6 @@ export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
 
       nsfwPolicy: this.nsfwPolicy,
 
-      // FIXME: deprecated in 4.1
-      webTorrentEnabled: this.p2pEnabled,
       p2pEnabled: this.p2pEnabled,
 
       videosHistoryEnabled: this.videosHistoryEnabled,
index cbd57ad8c922e009ff3fee4b8f0c1bae14baa459..56a00aa0c661e7707b40df4197a6d696f31d6e7f 100644 (file)
@@ -111,7 +111,7 @@ export class AbstractVideoQueryBuilder extends AbstractRunQuery {
     }
   }
 
-  protected includeWebtorrentFiles () {
+  protected includeWebVideoFiles () {
     this.addJoin('LEFT JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"')
 
     this.attributes = {
@@ -263,7 +263,7 @@ export class AbstractVideoQueryBuilder extends AbstractRunQuery {
     }
   }
 
-  protected includeWebTorrentRedundancies () {
+  protected includeWebVideoRedundancies () {
     this.addJoin(
       'LEFT OUTER JOIN "videoRedundancy" AS "VideoFiles->RedundancyVideos" ON ' +
         '"VideoFiles"."id" = "VideoFiles->RedundancyVideos"."videoFileId"'
index cc53a486064d6573cadb00b8492bcb3365498668..196b72b43f2076323f13fa2b0e31131b3e16020c 100644 (file)
@@ -14,7 +14,7 @@ export type FileQueryOptions = {
 
 /**
  *
- * Fetch files (webtorrent and streaming playlist) according to a video
+ * Fetch files (web videos and streaming playlist) according to a video
  *
  */
 
@@ -25,8 +25,8 @@ export class VideoFileQueryBuilder extends AbstractVideoQueryBuilder {
     super(sequelize, 'get')
   }
 
-  queryWebTorrentVideos (options: FileQueryOptions) {
-    this.buildWebtorrentFilesQuery(options)
+  queryWebVideos (options: FileQueryOptions) {
+    this.buildWebVideoFilesQuery(options)
 
     return this.runQuery(options)
   }
@@ -37,15 +37,15 @@ export class VideoFileQueryBuilder extends AbstractVideoQueryBuilder {
     return this.runQuery(options)
   }
 
-  private buildWebtorrentFilesQuery (options: FileQueryOptions) {
+  private buildWebVideoFilesQuery (options: FileQueryOptions) {
     this.attributes = {
       '"video"."id"': ''
     }
 
-    this.includeWebtorrentFiles()
+    this.includeWebVideoFiles()
 
     if (options.includeRedundancy) {
-      this.includeWebTorrentRedundancies()
+      this.includeWebVideoRedundancies()
     }
 
     this.whereId(options)
index 0a2beb7dbcbd2d70aeb53dc6cd1fd6a3c0f3f008..740aa842f09265582ca5de21ecb5e142ed2a6208 100644 (file)
@@ -60,10 +60,10 @@ export class VideoModelBuilder {
   buildVideosFromRows (options: {
     rows: SQLRow[]
     include?: VideoInclude
-    rowsWebTorrentFiles?: SQLRow[]
+    rowsWebVideoFiles?: SQLRow[]
     rowsStreamingPlaylist?: SQLRow[]
   }) {
-    const { rows, rowsWebTorrentFiles, rowsStreamingPlaylist, include } = options
+    const { rows, rowsWebVideoFiles, rowsStreamingPlaylist, include } = options
 
     this.reinit()
 
@@ -85,8 +85,8 @@ export class VideoModelBuilder {
         this.addActorAvatar(row, 'VideoChannel.Account.Actor', accountActor)
       }
 
-      if (!rowsWebTorrentFiles) {
-        this.addWebTorrentFile(row, videoModel)
+      if (!rowsWebVideoFiles) {
+        this.addWebVideoFile(row, videoModel)
       }
 
       if (!rowsStreamingPlaylist) {
@@ -112,7 +112,7 @@ export class VideoModelBuilder {
       }
     }
 
-    this.grabSeparateWebTorrentFiles(rowsWebTorrentFiles)
+    this.grabSeparateWebVideoFiles(rowsWebVideoFiles)
     this.grabSeparateStreamingPlaylistFiles(rowsStreamingPlaylist)
 
     return this.videos
@@ -140,15 +140,15 @@ export class VideoModelBuilder {
     this.videos = []
   }
 
-  private grabSeparateWebTorrentFiles (rowsWebTorrentFiles?: SQLRow[]) {
-    if (!rowsWebTorrentFiles) return
+  private grabSeparateWebVideoFiles (rowsWebVideoFiles?: SQLRow[]) {
+    if (!rowsWebVideoFiles) return
 
-    for (const row of rowsWebTorrentFiles) {
+    for (const row of rowsWebVideoFiles) {
       const id = row['VideoFiles.id']
       if (!id) continue
 
       const videoModel = this.videosMemo[row.id]
-      this.addWebTorrentFile(row, videoModel)
+      this.addWebVideoFile(row, videoModel)
       this.addRedundancy(row, 'VideoFiles', this.videoFileMemo[id])
     }
   }
@@ -258,7 +258,7 @@ export class VideoModelBuilder {
     this.thumbnailsDone.add(id)
   }
 
-  private addWebTorrentFile (row: SQLRow, videoModel: VideoModel) {
+  private addWebVideoFile (row: SQLRow, videoModel: VideoModel) {
     const id = row['VideoFiles.id']
     if (!id || this.videoFileMemo[id]) return
 
index 8e90ff6411aa97d8c3114d10450dfc59fb586388..3f43d4d921d8cfd0f6e82072048b44c01e3b9563 100644 (file)
@@ -35,7 +35,7 @@ export type BuildVideoGetQueryOptions = {
 
 export class VideoModelGetQueryBuilder {
   videoQueryBuilder: VideosModelGetQuerySubBuilder
-  webtorrentFilesQueryBuilder: VideoFileQueryBuilder
+  webVideoFilesQueryBuilder: VideoFileQueryBuilder
   streamingPlaylistFilesQueryBuilder: VideoFileQueryBuilder
 
   private readonly videoModelBuilder: VideoModelBuilder
@@ -44,7 +44,7 @@ export class VideoModelGetQueryBuilder {
 
   constructor (protected readonly sequelize: Sequelize) {
     this.videoQueryBuilder = new VideosModelGetQuerySubBuilder(sequelize)
-    this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
+    this.webVideoFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
     this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
 
     this.videoModelBuilder = new VideoModelBuilder('get', new VideoTableAttributes('get'))
@@ -57,11 +57,11 @@ export class VideoModelGetQueryBuilder {
       includeRedundancy: this.shouldIncludeRedundancies(options)
     }
 
-    const [ videoRows, webtorrentFilesRows, streamingPlaylistFilesRows ] = await Promise.all([
+    const [ videoRows, webVideoFilesRows, streamingPlaylistFilesRows ] = await Promise.all([
       this.videoQueryBuilder.queryVideos(options),
 
       VideoModelGetQueryBuilder.videoFilesInclude.has(options.type)
-        ? this.webtorrentFilesQueryBuilder.queryWebTorrentVideos(fileQueryOptions)
+        ? this.webVideoFilesQueryBuilder.queryWebVideos(fileQueryOptions)
         : Promise.resolve(undefined),
 
       VideoModelGetQueryBuilder.videoFilesInclude.has(options.type)
@@ -71,7 +71,7 @@ export class VideoModelGetQueryBuilder {
 
     const videos = this.videoModelBuilder.buildVideosFromRows({
       rows: videoRows,
-      rowsWebTorrentFiles: webtorrentFilesRows,
+      rowsWebVideoFiles: webVideoFilesRows,
       rowsStreamingPlaylist: streamingPlaylistFilesRows
     })
 
@@ -92,7 +92,7 @@ export class VideoModelGetQueryBuilder {
 export class VideosModelGetQuerySubBuilder extends AbstractVideoQueryBuilder {
   protected attributes: { [key: string]: string }
 
-  protected webtorrentFilesQuery: string
+  protected webVideoFilesQuery: string
   protected streamingPlaylistFilesQuery: string
 
   private static readonly trackersInclude = new Set<GetType>([ 'api' ])
index cba77c1d1add755023155a7974cdf8090cfb13be..7f2376102042ae0614817a7009fb3e9c05f32074 100644 (file)
@@ -48,7 +48,9 @@ export type BuildVideosListQueryOptions = {
 
   hasFiles?: boolean
   hasHLSFiles?: boolean
-  hasWebtorrentFiles?: boolean
+
+  hasWebVideoFiles?: boolean
+  hasWebtorrentFiles?: boolean // TODO: Remove in v7
 
   accountId?: number
   videoChannelId?: number
@@ -175,7 +177,9 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery {
     }
 
     if (exists(options.hasWebtorrentFiles)) {
-      this.whereWebTorrentFileExists(options.hasWebtorrentFiles)
+      this.whereWebVideoFileExists(options.hasWebtorrentFiles)
+    } else if (exists(options.hasWebVideoFiles)) {
+      this.whereWebVideoFileExists(options.hasWebVideoFiles)
     }
 
     if (exists(options.hasHLSFiles)) {
@@ -400,18 +404,18 @@ export class VideosIdListQueryBuilder extends AbstractRunQuery {
   }
 
   private whereFileExists () {
-    this.and.push(`(${this.buildWebTorrentFileExistsQuery(true)} OR ${this.buildHLSFileExistsQuery(true)})`)
+    this.and.push(`(${this.buildWebVideoFileExistsQuery(true)} OR ${this.buildHLSFileExistsQuery(true)})`)
   }
 
-  private whereWebTorrentFileExists (exists: boolean) {
-    this.and.push(this.buildWebTorrentFileExistsQuery(exists))
+  private whereWebVideoFileExists (exists: boolean) {
+    this.and.push(this.buildWebVideoFileExistsQuery(exists))
   }
 
   private whereHLSFileExists (exists: boolean) {
     this.and.push(this.buildHLSFileExistsQuery(exists))
   }
 
-  private buildWebTorrentFileExistsQuery (exists: boolean) {
+  private buildWebVideoFileExistsQuery (exists: boolean) {
     const prefix = exists ? '' : 'NOT '
 
     return prefix + 'EXISTS (SELECT 1 FROM "videoFile" WHERE "videoFile"."videoId" = "video"."id")'
index 3fdac4ed34e334a4c3363cfd7dd79cb28d086788..b73dc28cd5c760e7fad59cf75eaef811840f4e47 100644 (file)
@@ -18,7 +18,7 @@ export class VideosModelListQueryBuilder extends AbstractVideoQueryBuilder {
   private innerQuery: string
   private innerSort: string
 
-  webtorrentFilesQueryBuilder: VideoFileQueryBuilder
+  webVideoFilesQueryBuilder: VideoFileQueryBuilder
   streamingPlaylistFilesQueryBuilder: VideoFileQueryBuilder
 
   private readonly videoModelBuilder: VideoModelBuilder
@@ -27,7 +27,7 @@ export class VideosModelListQueryBuilder extends AbstractVideoQueryBuilder {
     super(sequelize, 'list')
 
     this.videoModelBuilder = new VideoModelBuilder(this.mode, this.tables)
-    this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
+    this.webVideoFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
     this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
   }
 
@@ -48,12 +48,12 @@ export class VideosModelListQueryBuilder extends AbstractVideoQueryBuilder {
           includeRedundancy: false
         }
 
-        const [ rowsWebTorrentFiles, rowsStreamingPlaylist ] = await Promise.all([
-          this.webtorrentFilesQueryBuilder.queryWebTorrentVideos(fileQueryOptions),
+        const [ rowsWebVideoFiles, rowsStreamingPlaylist ] = await Promise.all([
+          this.webVideoFilesQueryBuilder.queryWebVideos(fileQueryOptions),
           this.streamingPlaylistFilesQueryBuilder.queryStreamingPlaylistVideos(fileQueryOptions)
         ])
 
-        return this.videoModelBuilder.buildVideosFromRows({ rows, include: options.include, rowsStreamingPlaylist, rowsWebTorrentFiles })
+        return this.videoModelBuilder.buildVideosFromRows({ rows, include: options.include, rowsStreamingPlaylist, rowsWebVideoFiles })
       }
     }
 
index 2db4b523a654b6fda12274fed3f54dfe2325a7ff..26f072f4f61095855d90631a1b49dfb521e24a84 100644 (file)
@@ -45,7 +45,7 @@ enum ScopeNames {
       {
         model: VideoModel.scope([
           VideoScopeNames.WITH_THUMBNAILS,
-          VideoScopeNames.WITH_WEBTORRENT_FILES,
+          VideoScopeNames.WITH_WEB_VIDEO_FILES,
           VideoScopeNames.WITH_STREAMING_PLAYLISTS,
           VideoScopeNames.WITH_ACCOUNT_DETAILS
         ]),
index 07bc13de1a9938d29f161047318e29712cb07aef..5e476f3c7058e03ce5badb6b4483af820c87292b 100644 (file)
@@ -26,8 +26,8 @@ import { buildRemoteVideoBaseUrl } from '@server/lib/activitypub/url'
 import {
   getHLSPrivateFileUrl,
   getHLSPublicFileUrl,
-  getWebTorrentPrivateFileUrl,
-  getWebTorrentPublicFileUrl
+  getWebVideoPrivateFileUrl,
+  getWebVideoPublicFileUrl
 } from '@server/lib/object-storage'
 import { getFSTorrentFilePath } from '@server/lib/paths'
 import { isVideoInPrivateDirectory } from '@server/lib/video-privacy'
@@ -276,15 +276,15 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
 
   static async doesOwnedTorrentFileExist (filename: string) {
     const query = 'SELECT 1 FROM "videoFile" ' +
-                  'LEFT JOIN "video" "webtorrent" ON "webtorrent"."id" = "videoFile"."videoId" AND "webtorrent"."remote" IS FALSE ' +
+                  'LEFT JOIN "video" "webvideo" ON "webvideo"."id" = "videoFile"."videoId" AND "webvideo"."remote" IS FALSE ' +
                   'LEFT JOIN "videoStreamingPlaylist" ON "videoStreamingPlaylist"."id" = "videoFile"."videoStreamingPlaylistId" ' +
                   'LEFT JOIN "video" "hlsVideo" ON "hlsVideo"."id" = "videoStreamingPlaylist"."videoId" AND "hlsVideo"."remote" IS FALSE ' +
-                  'WHERE "torrentFilename" = $filename AND ("hlsVideo"."id" IS NOT NULL OR "webtorrent"."id" IS NOT NULL) LIMIT 1'
+                  'WHERE "torrentFilename" = $filename AND ("hlsVideo"."id" IS NOT NULL OR "webvideo"."id" IS NOT NULL) LIMIT 1'
 
     return doesExist(this.sequelize, query, { filename })
   }
 
-  static async doesOwnedWebTorrentVideoFileExist (filename: string) {
+  static async doesOwnedWebVideoFileExist (filename: string) {
     const query = 'SELECT 1 FROM "videoFile" INNER JOIN "video" ON "video"."id" = "videoFile"."videoId" AND "video"."remote" IS FALSE ' +
                   `WHERE "filename" = $filename AND "storage" = ${VideoStorage.FILE_SYSTEM} LIMIT 1`
 
@@ -378,7 +378,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
   }
 
   static getStats () {
-    const webtorrentFilesQuery: FindOptions = {
+    const webVideoFilesQuery: FindOptions = {
       include: [
         {
           attributes: [],
@@ -412,10 +412,10 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
     }
 
     return Promise.all([
-      VideoFileModel.aggregate('size', 'SUM', webtorrentFilesQuery),
+      VideoFileModel.aggregate('size', 'SUM', webVideoFilesQuery),
       VideoFileModel.aggregate('size', 'SUM', hlsFilesQuery)
-    ]).then(([ webtorrentResult, hlsResult ]) => ({
-      totalLocalVideoFilesSize: parseAggregateResult(webtorrentResult) + parseAggregateResult(hlsResult)
+    ]).then(([ webVideoResult, hlsResult ]) => ({
+      totalLocalVideoFilesSize: parseAggregateResult(webVideoResult) + parseAggregateResult(hlsResult)
     }))
   }
 
@@ -433,7 +433,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
 
     const element = mode === 'streaming-playlist'
       ? await VideoFileModel.loadHLSFile({ ...baseFind, playlistId: videoFile.videoStreamingPlaylistId })
-      : await VideoFileModel.loadWebTorrentFile({ ...baseFind, videoId: videoFile.videoId })
+      : await VideoFileModel.loadWebVideoFile({ ...baseFind, videoId: videoFile.videoId })
 
     if (!element) return videoFile.save({ transaction })
 
@@ -444,7 +444,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
     return element.save({ transaction })
   }
 
-  static async loadWebTorrentFile (options: {
+  static async loadWebVideoFile (options: {
     videoId: number
     fps: number
     resolution: number
@@ -523,7 +523,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
       return getHLSPrivateFileUrl(video, this.filename)
     }
 
-    return getWebTorrentPrivateFileUrl(this.filename)
+    return getWebVideoPrivateFileUrl(this.filename)
   }
 
   private getPublicObjectStorageUrl () {
@@ -531,7 +531,7 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
       return getHLSPublicFileUrl(this.fileUrl)
     }
 
-    return getWebTorrentPublicFileUrl(this.fileUrl)
+    return getWebVideoPublicFileUrl(this.fileUrl)
   }
 
   // ---------------------------------------------------------------------------
@@ -553,10 +553,10 @@ export class VideoFileModel extends Model<Partial<AttributesOnly<VideoFileModel>
   getFileStaticPath (video: MVideo) {
     if (this.isHLS()) return this.getHLSFileStaticPath(video)
 
-    return this.getWebTorrentFileStaticPath(video)
+    return this.getWebVideoFileStaticPath(video)
   }
 
-  private getWebTorrentFileStaticPath (video: MVideo) {
+  private getWebVideoFileStaticPath (video: MVideo) {
     if (isVideoInPrivateDirectory(video.privacy)) {
       return join(STATIC_PATHS.PRIVATE_WEBSEED, this.filename)
     }
index 3a0d95b6257a3676fa1e45bb2d805ac533a34f39..4c62972434feebce8a4356b1d70184df59aa44cd 100644 (file)
@@ -29,7 +29,7 @@ import {
 import { getPrivaciesForFederation, isPrivacyForFederation, isStateForFederation } from '@server/helpers/video'
 import { InternalEventEmitter } from '@server/lib/internal-event-emitter'
 import { LiveManager } from '@server/lib/live/live-manager'
-import { removeHLSFileObjectStorageByFilename, removeHLSObjectStorage, removeWebTorrentObjectStorage } from '@server/lib/object-storage'
+import { removeHLSFileObjectStorageByFilename, removeHLSObjectStorage, removeWebVideoObjectStorage } from '@server/lib/object-storage'
 import { tracer } from '@server/lib/opentelemetry/tracing'
 import { getHLSDirectory, getHLSRedundancyDirectory, getHlsResolutionPlaylistFilename } from '@server/lib/paths'
 import { Hooks } from '@server/lib/plugins/hooks'
@@ -151,7 +151,7 @@ export enum ScopeNames {
   FOR_API = 'FOR_API',
   WITH_ACCOUNT_DETAILS = 'WITH_ACCOUNT_DETAILS',
   WITH_TAGS = 'WITH_TAGS',
-  WITH_WEBTORRENT_FILES = 'WITH_WEBTORRENT_FILES',
+  WITH_WEB_VIDEO_FILES = 'WITH_WEB_VIDEO_FILES',
   WITH_SCHEDULED_UPDATE = 'WITH_SCHEDULED_UPDATE',
   WITH_BLACKLISTED = 'WITH_BLACKLISTED',
   WITH_STREAMING_PLAYLISTS = 'WITH_STREAMING_PLAYLISTS',
@@ -290,7 +290,7 @@ export type ForAPIOptions = {
       }
     ]
   },
-  [ScopeNames.WITH_WEBTORRENT_FILES]: (withRedundancies = false) => {
+  [ScopeNames.WITH_WEB_VIDEO_FILES]: (withRedundancies = false) => {
     let subInclude: any[] = []
 
     if (withRedundancies === true) {
@@ -813,7 +813,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
 
       // Remove physical files and torrents
       instance.VideoFiles.forEach(file => {
-        tasks.push(instance.removeWebTorrentFile(file))
+        tasks.push(instance.removeWebVideoFile(file))
       })
 
       // Remove playlists file
@@ -1107,7 +1107,10 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     include?: VideoInclude
 
     hasFiles?: boolean // default false
-    hasWebtorrentFiles?: boolean
+
+    hasWebtorrentFiles?: boolean // TODO: remove in v7
+    hasWebVideoFiles?: boolean
+
     hasHLSFiles?: boolean
 
     categoryOneOf?: number[]
@@ -1172,6 +1175,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
         'historyOfUser',
         'hasHLSFiles',
         'hasWebtorrentFiles',
+        'hasWebVideoFiles',
         'search',
         'excludeAlreadyWatched'
       ]),
@@ -1205,7 +1209,9 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
 
     user?: MUserAccountId
 
-    hasWebtorrentFiles?: boolean
+    hasWebtorrentFiles?: boolean // TODO: remove in v7
+    hasWebVideoFiles?: boolean
+
     hasHLSFiles?: boolean
 
     search?: string
@@ -1252,6 +1258,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
         'durationMax',
         'hasHLSFiles',
         'hasWebtorrentFiles',
+        'hasWebVideoFiles',
         'uuids',
         'search',
         'displayOnlyForFollower',
@@ -1676,7 +1683,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     return this.getQualityFileBy(minBy)
   }
 
-  getWebTorrentFile<T extends MVideoWithFile> (this: T, resolution: number): MVideoFileVideo {
+  getWebVideoFile<T extends MVideoWithFile> (this: T, resolution: number): MVideoFileVideo {
     if (Array.isArray(this.VideoFiles) === false) return undefined
 
     const file = this.VideoFiles.find(f => f.resolution === resolution)
@@ -1685,7 +1692,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     return Object.assign(file, { Video: this })
   }
 
-  hasWebTorrentFiles () {
+  hasWebVideoFiles () {
     return Array.isArray(this.VideoFiles) === true && this.VideoFiles.length !== 0
   }
 
@@ -1884,7 +1891,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
                                        .concat(toAdd)
   }
 
-  removeWebTorrentFile (videoFile: MVideoFile, isRedundancy = false) {
+  removeWebVideoFile (videoFile: MVideoFile, isRedundancy = false) {
     const filePath = isRedundancy
       ? VideoPathManager.Instance.getFSRedundancyVideoFilePath(this, videoFile)
       : VideoPathManager.Instance.getFSVideoFileOutputPath(this, videoFile)
@@ -1893,7 +1900,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     if (!isRedundancy) promises.push(videoFile.removeTorrent())
 
     if (videoFile.storage === VideoStorage.OBJECT_STORAGE) {
-      promises.push(removeWebTorrentObjectStorage(videoFile))
+      promises.push(removeWebVideoObjectStorage(videoFile))
     }
 
     return Promise.all(promises)
index 3c752cc3e0a3fcf95876c9f8ffaed4f3894b7683..7f825f79e822345dc15253d8f06a357dfce6fb8f 100644 (file)
@@ -345,7 +345,7 @@ describe('Test config API validators', function () {
       })
     })
 
-    it('Should fail with a disabled webtorrent & hls transcoding', async function () {
+    it('Should fail with a disabled web videos & hls transcoding', async function () {
       const newUpdateParams = {
         ...updateParams,
 
index 9846ac18296b257b5a91ff96ff46cf52d36511ca..4bebcb52836fe602d9941a98d730df77aa06f539 100644 (file)
@@ -49,21 +49,21 @@ describe('Test transcoding API validators', function () {
 
   it('Should not run transcoding of a unknown video', async function () {
     await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'hls', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
-    await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'webtorrent', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+    await servers[0].videos.runTranscoding({ videoId: 404, transcodingType: 'web-video', expectedStatus: HttpStatusCode.NOT_FOUND_404 })
   })
 
   it('Should not run transcoding of a remote video', async function () {
     const expectedStatus = HttpStatusCode.BAD_REQUEST_400
 
     await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'hls', expectedStatus })
-    await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'webtorrent', expectedStatus })
+    await servers[0].videos.runTranscoding({ videoId: remoteId, transcodingType: 'web-video', expectedStatus })
   })
 
   it('Should not run transcoding by a non admin user', async function () {
     const expectedStatus = HttpStatusCode.FORBIDDEN_403
 
     await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', token: userToken, expectedStatus })
-    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', token: moderatorToken, expectedStatus })
+    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', token: moderatorToken, expectedStatus })
   })
 
   it('Should not run transcoding without transcoding type', async function () {
@@ -82,7 +82,7 @@ describe('Test transcoding API validators', function () {
     await servers[0].config.disableTranscoding()
 
     await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls', expectedStatus })
-    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', expectedStatus })
+    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', expectedStatus })
   })
 
   it('Should run transcoding', async function () {
@@ -93,15 +93,15 @@ describe('Test transcoding API validators', function () {
     await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'hls' })
     await waitJobs(servers)
 
-    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent' })
+    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video' })
     await waitJobs(servers)
   })
 
   it('Should not run transcoding on a video that is already being transcoded', async function () {
-    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent' })
+    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video' })
 
     const expectedStatus = HttpStatusCode.CONFLICT_409
-    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'webtorrent', expectedStatus })
+    await servers[0].videos.runTranscoding({ videoId: validId, transcodingType: 'web-video', expectedStatus })
   })
 
   after(async function () {
index 9dc59a1b5049cf8950972d78f9ac64edfb205c9e..4d43ab6f82106b6b829a97417d1faf356e3d0604 100644 (file)
@@ -60,7 +60,7 @@ describe('Test videos files', function () {
   })
 
   describe('Deleting files', function () {
-    let webtorrentId: string
+    let webVideoId: string
     let hlsId: string
     let remoteId: string
 
@@ -68,10 +68,10 @@ describe('Test videos files', function () {
     let validId2: string
 
     let hlsFileId: number
-    let webtorrentFileId: number
+    let webVideoFileId: number
 
     let remoteHLSFileId: number
-    let remoteWebtorrentFileId: number
+    let remoteWebVideoFileId: number
 
     before(async function () {
       this.timeout(300_000)
@@ -83,7 +83,7 @@ describe('Test videos files', function () {
         const video = await servers[1].videos.get({ id: uuid })
         remoteId = video.uuid
         remoteHLSFileId = video.streamingPlaylists[0].files[0].id
-        remoteWebtorrentFileId = video.files[0].id
+        remoteWebVideoFileId = video.files[0].id
       }
 
       {
@@ -96,7 +96,7 @@ describe('Test videos files', function () {
           const video = await servers[0].videos.get({ id: uuid })
           validId1 = video.uuid
           hlsFileId = video.streamingPlaylists[0].files[0].id
-          webtorrentFileId = video.files[0].id
+          webVideoFileId = video.files[0].id
         }
 
         {
@@ -117,8 +117,8 @@ describe('Test videos files', function () {
 
       {
         await servers[0].config.enableTranscoding(false, true)
-        const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' })
-        webtorrentId = uuid
+        const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' })
+        webVideoId = uuid
       }
 
       await waitJobs(servers)
@@ -128,27 +128,27 @@ describe('Test videos files', function () {
       const expectedStatus = HttpStatusCode.NOT_FOUND_404
 
       await servers[0].videos.removeHLSPlaylist({ videoId: 404, expectedStatus })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: 404, expectedStatus })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: 404, expectedStatus })
 
       await servers[0].videos.removeHLSFile({ videoId: 404, fileId: hlsFileId, expectedStatus })
-      await servers[0].videos.removeWebTorrentFile({ videoId: 404, fileId: webtorrentFileId, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: 404, fileId: webVideoFileId, expectedStatus })
     })
 
     it('Should not delete unknown files', async function () {
       const expectedStatus = HttpStatusCode.NOT_FOUND_404
 
-      await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: webtorrentFileId, expectedStatus })
-      await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: hlsFileId, expectedStatus })
+      await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: webVideoFileId, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: hlsFileId, expectedStatus })
     })
 
     it('Should not delete files of a remote video', async function () {
       const expectedStatus = HttpStatusCode.BAD_REQUEST_400
 
       await servers[0].videos.removeHLSPlaylist({ videoId: remoteId, expectedStatus })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: remoteId, expectedStatus })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: remoteId, expectedStatus })
 
       await servers[0].videos.removeHLSFile({ videoId: remoteId, fileId: remoteHLSFileId, expectedStatus })
-      await servers[0].videos.removeWebTorrentFile({ videoId: remoteId, fileId: remoteWebtorrentFileId, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: remoteId, fileId: remoteWebVideoFileId, expectedStatus })
     })
 
     it('Should not delete files by a non admin user', async function () {
@@ -157,35 +157,35 @@ describe('Test videos files', function () {
       await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: userToken, expectedStatus })
       await servers[0].videos.removeHLSPlaylist({ videoId: validId1, token: moderatorToken, expectedStatus })
 
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1, token: userToken, expectedStatus })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1, token: moderatorToken, expectedStatus })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1, token: userToken, expectedStatus })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1, token: moderatorToken, expectedStatus })
 
       await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: userToken, expectedStatus })
       await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId, token: moderatorToken, expectedStatus })
 
-      await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId, token: userToken, expectedStatus })
-      await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId, token: moderatorToken, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId, token: userToken, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId, token: moderatorToken, expectedStatus })
     })
 
     it('Should not delete files if the files are not available', async function () {
       await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: webtorrentId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: webVideoId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
 
       await servers[0].videos.removeHLSFile({ videoId: hlsId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
-      await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
+      await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: 404, expectedStatus: HttpStatusCode.NOT_FOUND_404 })
     })
 
     it('Should not delete files if no both versions are available', async function () {
       await servers[0].videos.removeHLSPlaylist({ videoId: hlsId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: webtorrentId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: webVideoId, expectedStatus: HttpStatusCode.BAD_REQUEST_400 })
     })
 
     it('Should delete files if both versions are available', async function () {
       await servers[0].videos.removeHLSFile({ videoId: validId1, fileId: hlsFileId })
-      await servers[0].videos.removeWebTorrentFile({ videoId: validId1, fileId: webtorrentFileId })
+      await servers[0].videos.removeWebVideoFile({ videoId: validId1, fileId: webVideoFileId })
 
       await servers[0].videos.removeHLSPlaylist({ videoId: validId1 })
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId2 })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: validId2 })
     })
   })
 
index 2a7c3381dc7baeabc8d2a8151106d213fc8889fd..18d30a2f5eb704e630ff7c1ddab6289532b4059f 100644 (file)
@@ -120,7 +120,7 @@ describe('Object storage for video static file privacy', function () {
       const video = await server.videos.getWithToken({ id: videoId })
 
       return {
-        webTorrentFile: video.files[0].fileUrl,
+        webVideoFile: video.files[0].fileUrl,
         hlsFile: getHLS(video).files[0].fileUrl
       }
     }
@@ -175,10 +175,10 @@ describe('Object storage for video static file privacy', function () {
     it('Should not get files without appropriate OAuth token', async function () {
       this.timeout(60000)
 
-      const { webTorrentFile, hlsFile } = await getSampleFileUrls(privateVideoUUID)
+      const { webVideoFile, hlsFile } = await getSampleFileUrls(privateVideoUUID)
 
-      await makeRawRequest({ url: webTorrentFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
-      await makeRawRequest({ url: webTorrentFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
+      await makeRawRequest({ url: webVideoFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+      await makeRawRequest({ url: webVideoFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
 
       await makeRawRequest({ url: hlsFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
       await makeRawRequest({ url: hlsFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
@@ -187,18 +187,18 @@ describe('Object storage for video static file privacy', function () {
     it('Should not get files without appropriate password or appropriate OAuth token', async function () {
       this.timeout(60000)
 
-      const { webTorrentFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID)
+      const { webVideoFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID)
 
-      await makeRawRequest({ url: webTorrentFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
+      await makeRawRequest({ url: webVideoFile, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
       await makeRawRequest({
-        url: webTorrentFile,
+        url: webVideoFile,
         token: null,
         headers: incorrectPasswordHeader,
         expectedStatus: HttpStatusCode.FORBIDDEN_403
       })
-      await makeRawRequest({ url: webTorrentFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
+      await makeRawRequest({ url: webVideoFile, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
       await makeRawRequest({
-        url: webTorrentFile,
+        url: webVideoFile,
         token: null,
         headers: correctPasswordHeader,
         expectedStatus: HttpStatusCode.OK_200
@@ -239,9 +239,9 @@ describe('Object storage for video static file privacy', function () {
       const badVideoFileToken = await server.videoToken.getVideoFileToken({ token: userToken, videoId: userPrivateVideoUUID })
       const goodVideoFileToken = await server.videoToken.getVideoFileToken({ videoId: privateVideoUUID })
 
-      const { webTorrentFile, hlsFile } = await getSampleFileUrls(privateVideoUUID)
+      const { webVideoFile, hlsFile } = await getSampleFileUrls(privateVideoUUID)
 
-      for (const url of [ webTorrentFile, hlsFile ]) {
+      for (const url of [ webVideoFile, hlsFile ]) {
         await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
         await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
         await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
@@ -261,9 +261,9 @@ describe('Object storage for video static file privacy', function () {
         videoPassword: correctPassword
       })
 
-      const { webTorrentFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID)
+      const { webVideoFile, hlsFile } = await getSampleFileUrls(passwordProtectedVideoUUID)
 
-      for (const url of [ hlsFile, webTorrentFile ]) {
+      for (const url of [ hlsFile, webVideoFile ]) {
         await makeRawRequest({ url, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
         await makeRawRequest({ url, token: userToken, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
         await makeRawRequest({ url, token: server.accessToken, expectedStatus: HttpStatusCode.OK_200 })
@@ -534,11 +534,11 @@ describe('Object storage for video static file privacy', function () {
 
     it('Should not be able to access object storage proxy', async function () {
       const privateVideo = await server.videos.getWithToken({ id: videoUUID })
-      const webtorrentFilename = extractFilenameFromUrl(privateVideo.files[0].fileUrl)
+      const webVideoFilename = extractFilenameFromUrl(privateVideo.files[0].fileUrl)
       const hlsFilename = extractFilenameFromUrl(getHLS(privateVideo).files[0].fileUrl)
 
       await makeRawRequest({
-        url: server.url + '/object-storage-proxy/webseed/private/' + webtorrentFilename,
+        url: server.url + '/object-storage-proxy/webseed/private/' + webVideoFilename,
         token: server.accessToken,
         expectedStatus: HttpStatusCode.BAD_REQUEST_400
       })
index f837d9966fed9cd814381a4dee461509f092b469..c4f72bbe4003647b71d4a8f973a5d47b4d8d38d2 100644 (file)
@@ -41,8 +41,8 @@ async function checkFiles (options: {
   playlistBucket: string
   playlistPrefix?: string
 
-  webtorrentBucket: string
-  webtorrentPrefix?: string
+  webVideoBucket: string
+  webVideoPrefix?: string
 }) {
   const {
     server,
@@ -50,20 +50,20 @@ async function checkFiles (options: {
     originSQLCommand,
     video,
     playlistBucket,
-    webtorrentBucket,
+    webVideoBucket,
     baseMockUrl,
     playlistPrefix,
-    webtorrentPrefix
+    webVideoPrefix
   } = options
 
   let allFiles = video.files
 
   for (const file of video.files) {
     const baseUrl = baseMockUrl
-      ? `${baseMockUrl}/${webtorrentBucket}/`
-      : `http://${webtorrentBucket}.${ObjectStorageCommand.getMockEndpointHost()}/`
+      ? `${baseMockUrl}/${webVideoBucket}/`
+      : `http://${webVideoBucket}.${ObjectStorageCommand.getMockEndpointHost()}/`
 
-    const prefix = webtorrentPrefix || ''
+    const prefix = webVideoPrefix || ''
     const start = baseUrl + prefix
 
     expectStartWith(file.fileUrl, start)
@@ -134,8 +134,8 @@ function runTestSuite (options: {
   playlistBucket: string
   playlistPrefix?: string
 
-  webtorrentBucket: string
-  webtorrentPrefix?: string
+  webVideoBucket: string
+  webVideoPrefix?: string
 
   useMockBaseUrl?: boolean
 }) {
@@ -161,7 +161,7 @@ function runTestSuite (options: {
       : undefined
 
     await objectStorage.createMockBucket(options.playlistBucket)
-    await objectStorage.createMockBucket(options.webtorrentBucket)
+    await objectStorage.createMockBucket(options.webVideoBucket)
 
     const config = {
       object_storage: {
@@ -182,10 +182,10 @@ function runTestSuite (options: {
         },
 
         videos: {
-          bucket_name: options.webtorrentBucket,
-          prefix: options.webtorrentPrefix,
+          bucket_name: options.webVideoBucket,
+          prefix: options.webVideoPrefix,
           base_url: baseMockUrl
-            ? `${baseMockUrl}/${options.webtorrentBucket}`
+            ? `${baseMockUrl}/${options.webVideoBucket}`
             : undefined
         }
       }
@@ -386,27 +386,27 @@ describe('Object storage for videos', function () {
   describe('Test simple object storage', function () {
     runTestSuite({
       playlistBucket: objectStorage.getMockBucketName('streaming-playlists'),
-      webtorrentBucket: objectStorage.getMockBucketName('videos')
+      webVideoBucket: objectStorage.getMockBucketName('videos')
     })
   })
 
   describe('Test object storage with prefix', function () {
     runTestSuite({
       playlistBucket: objectStorage.getMockBucketName('mybucket'),
-      webtorrentBucket: objectStorage.getMockBucketName('mybucket'),
+      webVideoBucket: objectStorage.getMockBucketName('mybucket'),
 
       playlistPrefix: 'streaming-playlists_',
-      webtorrentPrefix: 'webtorrent_'
+      webVideoPrefix: 'webvideo_'
     })
   })
 
   describe('Test object storage with prefix and base URL', function () {
     runTestSuite({
       playlistBucket: objectStorage.getMockBucketName('mybucket'),
-      webtorrentBucket: objectStorage.getMockBucketName('mybucket'),
+      webVideoBucket: objectStorage.getMockBucketName('mybucket'),
 
       playlistPrefix: 'streaming-playlists/',
-      webtorrentPrefix: 'webtorrent/',
+      webVideoPrefix: 'webvideo/',
 
       useMockBaseUrl: true
     })
@@ -431,7 +431,7 @@ describe('Object storage for videos', function () {
     runTestSuite({
       maxUploadPart,
       playlistBucket: objectStorage.getMockBucketName('streaming-playlists'),
-      webtorrentBucket: objectStorage.getMockBucketName('videos'),
+      webVideoBucket: objectStorage.getMockBucketName('videos'),
       fixture
     })
   })
index 5262c503fbd8889fad0b21d51e617943a1d33239..b35059c2930e3effed611d646e82acdb646457d1 100644 (file)
@@ -43,7 +43,7 @@ async function checkMagnetWebseeds (file: VideoFile, baseWebseeds: string[], ser
   }
 }
 
-async function createServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebtorrent = true) {
+async function createServers (strategy: VideoRedundancyStrategy | null, additionalParams: any = {}, withWebVideo = true) {
   const strategies: any[] = []
 
   if (strategy !== null) {
@@ -61,7 +61,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition
   const config = {
     transcoding: {
       webtorrent: {
-        enabled: withWebtorrent
+        enabled: withWebVideo
       },
       hls: {
         enabled: true
@@ -100,7 +100,7 @@ async function createServers (strategy: VideoRedundancyStrategy | null, addition
 }
 
 async function ensureSameFilenames (videoUUID: string) {
-  let webtorrentFilenames: string[]
+  let webVideoFilenames: string[]
   let hlsFilenames: string[]
 
   for (const server of servers) {
@@ -108,17 +108,17 @@ async function ensureSameFilenames (videoUUID: string) {
 
     // Ensure we use the same filenames that the origin
 
-    const localWebtorrentFilenames = video.files.map(f => basename(f.fileUrl)).sort()
+    const localWebVideoFilenames = video.files.map(f => basename(f.fileUrl)).sort()
     const localHLSFilenames = video.streamingPlaylists[0].files.map(f => basename(f.fileUrl)).sort()
 
-    if (webtorrentFilenames) expect(webtorrentFilenames).to.deep.equal(localWebtorrentFilenames)
-    else webtorrentFilenames = localWebtorrentFilenames
+    if (webVideoFilenames) expect(webVideoFilenames).to.deep.equal(localWebVideoFilenames)
+    else webVideoFilenames = localWebVideoFilenames
 
     if (hlsFilenames) expect(hlsFilenames).to.deep.equal(localHLSFilenames)
     else hlsFilenames = localHLSFilenames
   }
 
-  return { webtorrentFilenames, hlsFilenames }
+  return { webVideoFilenames, hlsFilenames }
 }
 
 async function check1WebSeed (videoUUID?: string) {
@@ -156,7 +156,7 @@ async function check2Webseeds (videoUUID?: string) {
     }
   }
 
-  const { webtorrentFilenames } = await ensureSameFilenames(videoUUID)
+  const { webVideoFilenames } = await ensureSameFilenames(videoUUID)
 
   const directories = [
     servers[0].getDirectoryPath('redundancy'),
@@ -168,7 +168,7 @@ async function check2Webseeds (videoUUID?: string) {
     expect(files).to.have.length.at.least(4)
 
     // Ensure we files exist on disk
-    expect(files.find(f => webtorrentFilenames.includes(f))).to.exist
+    expect(files.find(f => webVideoFilenames.includes(f))).to.exist
   }
 }
 
index 1e31418e78b5b2f663d55b6f453edebe661da4c7..aa1113fc1f8919a8db79c9fdd828460fa83e1d2c 100644 (file)
@@ -14,7 +14,7 @@ import {
 describe('Test audio only video transcoding', function () {
   let servers: PeerTubeServer[] = []
   let videoUUID: string
-  let webtorrentAudioFileUrl: string
+  let webVideoAudioFileUrl: string
   let fragmentedAudioFileUrl: string
 
   before(async function () {
@@ -71,7 +71,7 @@ describe('Test audio only video transcoding', function () {
       }
 
       if (server.serverNumber === 1) {
-        webtorrentAudioFileUrl = video.files[2].fileUrl
+        webVideoAudioFileUrl = video.files[2].fileUrl
         fragmentedAudioFileUrl = video.streamingPlaylists[0].files[2].fileUrl
       }
     }
@@ -79,7 +79,7 @@ describe('Test audio only video transcoding', function () {
 
   it('0p transcoded video should not have video', async function () {
     const paths = [
-      servers[0].servers.buildWebTorrentFilePath(webtorrentAudioFileUrl),
+      servers[0].servers.buildWebVideoFilePath(webVideoAudioFileUrl),
       servers[0].servers.buildFragmentedFilePath(videoUUID, fragmentedAudioFileUrl)
     ]
 
index d6f5b01dce1b8c94e395ac64d153c091261d9789..21a63f54712a1c40aa2fd4791d488104f952ecdb 100644 (file)
@@ -96,12 +96,12 @@ function runTests (enableObjectStorage: boolean) {
     }
   })
 
-  it('Should generate WebTorrent', async function () {
+  it('Should generate Web Video', async function () {
     this.timeout(60000)
 
     await servers[0].videos.runTranscoding({
       videoId: videoUUID,
-      transcodingType: 'webtorrent'
+      transcodingType: 'web-video'
     })
 
     await waitJobs(servers)
@@ -117,13 +117,13 @@ function runTests (enableObjectStorage: boolean) {
     }
   })
 
-  it('Should generate WebTorrent from HLS only video', async function () {
+  it('Should generate Web Video from HLS only video', async function () {
     this.timeout(60000)
 
-    await servers[0].videos.removeAllWebTorrentFiles({ videoId: videoUUID })
+    await servers[0].videos.removeAllWebVideoFiles({ videoId: videoUUID })
     await waitJobs(servers)
 
-    await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' })
+    await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
     await waitJobs(servers)
 
     for (const server of servers) {
@@ -137,13 +137,13 @@ function runTests (enableObjectStorage: boolean) {
     }
   })
 
-  it('Should only generate WebTorrent', async function () {
+  it('Should only generate Web Video', async function () {
     this.timeout(60000)
 
     await servers[0].videos.removeHLSPlaylist({ videoId: videoUUID })
     await waitJobs(servers)
 
-    await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'webtorrent' })
+    await servers[0].videos.runTranscoding({ videoId: videoUUID, transcodingType: 'web-video' })
     await waitJobs(servers)
 
     for (const server of servers) {
index c668d7e0bca6210eb93444c179051c9dc0139935..ba889e71878867df7586a0310b8e488a35c4bce3 100644 (file)
@@ -111,7 +111,7 @@ describe('Test HLS videos', function () {
     await doubleFollow(servers[0], servers[1])
   })
 
-  describe('With WebTorrent & HLS enabled', function () {
+  describe('With Web Video & HLS enabled', function () {
     runTestSuite(false)
   })
 
index 3cd247a2487b8eaaebefc2f2d53b2ed290fe811f..36e1d90f4a8d69f2f45d9dde7948e1d97db735ab 100644 (file)
@@ -251,7 +251,7 @@ describe('Test video transcoding', function () {
         expect(videoDetails.files).to.have.lengthOf(5)
 
         const file = videoDetails.files.find(f => f.resolution.id === 240)
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
         const probe = await getAudioStream(path)
 
         if (probe.audioStream) {
@@ -281,7 +281,7 @@ describe('Test video transcoding', function () {
         const videoDetails = await server.videos.get({ id: video.id })
 
         const file = videoDetails.files.find(f => f.resolution.id === 240)
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
 
         expect(await hasAudioStream(path)).to.be.false
       }
@@ -310,7 +310,7 @@ describe('Test video transcoding', function () {
         const fixtureVideoProbe = await getAudioStream(fixturePath)
 
         const file = videoDetails.files.find(f => f.resolution.id === 240)
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
 
         const videoProbe = await getAudioStream(path)
 
@@ -472,14 +472,14 @@ describe('Test video transcoding', function () {
 
         for (const resolution of [ 144, 240, 360, 480 ]) {
           const file = videoDetails.files.find(f => f.resolution.id === resolution)
-          const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+          const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
           const fps = await getVideoStreamFPS(path)
 
           expect(fps).to.be.below(31)
         }
 
         const file = videoDetails.files.find(f => f.resolution.id === 720)
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
         const fps = await getVideoStreamFPS(path)
 
         expect(fps).to.be.above(58).and.below(62)
@@ -516,14 +516,14 @@ describe('Test video transcoding', function () {
 
         {
           const file = video.files.find(f => f.resolution.id === 240)
-          const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+          const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
           const fps = await getVideoStreamFPS(path)
           expect(fps).to.be.equal(25)
         }
 
         {
           const file = video.files.find(f => f.resolution.id === 720)
-          const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+          const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
           const fps = await getVideoStreamFPS(path)
           expect(fps).to.be.equal(59)
         }
@@ -556,7 +556,7 @@ describe('Test video transcoding', function () {
 
         for (const resolution of [ 240, 360, 480, 720, 1080 ]) {
           const file = video.files.find(f => f.resolution.id === resolution)
-          const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+          const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
 
           const bitrate = await getVideoStreamBitrate(path)
           const fps = await getVideoStreamFPS(path)
@@ -607,7 +607,7 @@ describe('Test video transcoding', function () {
       for (const r of resolutions) {
         const file = video.files.find(f => f.resolution.id === r)
 
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
         const bitrate = await getVideoStreamBitrate(path)
 
         const inputBitrate = 60_000
@@ -631,7 +631,7 @@ describe('Test video transcoding', function () {
       {
         const video = await servers[1].videos.get({ id: videoUUID })
         const file = video.files.find(f => f.resolution.id === 240)
-        const path = servers[1].servers.buildWebTorrentFilePath(file.fileUrl)
+        const path = servers[1].servers.buildWebVideoFilePath(file.fileUrl)
 
         const probe = await ffprobePromise(path)
         const metadata = new VideoFileMetadata(probe)
@@ -704,14 +704,14 @@ describe('Test video transcoding', function () {
       expect(transcodingJobs).to.have.lengthOf(16)
 
       const hlsJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-hls')
-      const webtorrentJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-webtorrent')
-      const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-webtorrent')
+      const webVideoJobs = transcodingJobs.filter(j => j.data.type === 'new-resolution-to-web-video')
+      const optimizeJobs = transcodingJobs.filter(j => j.data.type === 'optimize-to-web-video')
 
       expect(hlsJobs).to.have.lengthOf(8)
-      expect(webtorrentJobs).to.have.lengthOf(7)
+      expect(webVideoJobs).to.have.lengthOf(7)
       expect(optimizeJobs).to.have.lengthOf(1)
 
-      for (const j of optimizeJobs.concat(hlsJobs.concat(webtorrentJobs))) {
+      for (const j of optimizeJobs.concat(hlsJobs.concat(webVideoJobs))) {
         expect(j.priority).to.be.greaterThan(100)
         expect(j.priority).to.be.lessThan(150)
       }
index 61655f102100dbb133d17cf9d72f6f06743ba1c9..2e0edc7703f5366c49899d9986952201b42349f0 100644 (file)
@@ -96,7 +96,7 @@ describe('Test update video privacy while transcoding', function () {
     await doubleFollow(servers[0], servers[1])
   })
 
-  describe('With WebTorrent & HLS enabled', function () {
+  describe('With Web Video & HLS enabled', function () {
     runTestSuite(false)
   })
 
index e97f2b689ec8426036165fc8f92a77a036aace9d..2595d3cdbaaef2e89a7aac0f75aa53f2216402da 100644 (file)
@@ -273,7 +273,7 @@ describe('Test video studio', function () {
   describe('HLS only studio edition', function () {
 
     before(async function () {
-      // Disable webtorrent
+      // Disable Web Videos
       await servers[0].config.updateExistingSubConfig({
         newConfig: {
           transcoding: {
@@ -354,8 +354,8 @@ describe('Test video studio', function () {
           expect(oldFileUrls).to.not.include(f.fileUrl)
         }
 
-        for (const webtorrentFile of video.files) {
-          expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
+        for (const webVideoFile of video.files) {
+          expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
         }
 
         for (const hlsFile of video.streamingPlaylists[0].files) {
index 6969495044df47d552b51eff1282e1230cd3b13a..70f22e2ebc22a968c827f1c24b352e52f1fd1ebd 100644 (file)
@@ -184,7 +184,7 @@ describe('Test user videos', function () {
       }
     })
 
-    it('Should disable webtorrent, enable HLS, and update my quota', async function () {
+    it('Should disable web videos, enable HLS, and update my quota', async function () {
       this.timeout(160000)
 
       {
index 1c00f9a930fd51d5e3689e1f364c31b8609b23e7..67ade1d0dcf01c76c32a7344689d7e77b780f756 100644 (file)
@@ -229,25 +229,13 @@ describe('Test users', function () {
     })
 
     it('Should be able to change the p2p attribute', async function () {
-      {
-        await server.users.updateMe({
-          token: userToken,
-          webTorrentEnabled: false
-        })
-
-        const user = await server.users.getMyInfo({ token: userToken })
-        expect(user.p2pEnabled).to.be.false
-      }
-
-      {
-        await server.users.updateMe({
-          token: userToken,
-          p2pEnabled: true
-        })
+      await server.users.updateMe({
+        token: userToken,
+        p2pEnabled: true
+      })
 
-        const user = await server.users.getMyInfo({ token: userToken })
-        expect(user.p2pEnabled).to.be.true
-      }
+      const user = await server.users.getMyInfo({ token: userToken })
+      expect(user.p2pEnabled).to.be.true
     })
 
     it('Should be able to change the email attribute', async function () {
index 8c913bf31a1f49ef35cf3c83c3e7a784ce908da3..0a183c44d8d4c0a0c5564a6177b91683e5d807bf 100644 (file)
@@ -48,10 +48,10 @@ describe('Test videos files', function () {
       await waitJobs(servers)
     })
 
-    it('Should delete webtorrent files', async function () {
+    it('Should delete web video files', async function () {
       this.timeout(30_000)
 
-      await servers[0].videos.removeAllWebTorrentFiles({ videoId: validId1 })
+      await servers[0].videos.removeAllWebVideoFiles({ videoId: validId1 })
 
       await waitJobs(servers)
 
@@ -80,15 +80,15 @@ describe('Test videos files', function () {
   })
 
   describe('When deleting a specific file', function () {
-    let webtorrentId: string
+    let webVideoId: string
     let hlsId: string
 
     before(async function () {
       this.timeout(120_000)
 
       {
-        const { uuid } = await servers[0].videos.quickUpload({ name: 'webtorrent' })
-        webtorrentId = uuid
+        const { uuid } = await servers[0].videos.quickUpload({ name: 'web-video' })
+        webVideoId = uuid
       }
 
       {
@@ -99,38 +99,38 @@ describe('Test videos files', function () {
       await waitJobs(servers)
     })
 
-    it('Shoulde delete a webtorrent file', async function () {
+    it('Shoulde delete a web video file', async function () {
       this.timeout(30_000)
 
-      const video = await servers[0].videos.get({ id: webtorrentId })
+      const video = await servers[0].videos.get({ id: webVideoId })
       const files = video.files
 
-      await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: files[0].id })
+      await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: files[0].id })
 
       await waitJobs(servers)
 
       for (const server of servers) {
-        const video = await server.videos.get({ id: webtorrentId })
+        const video = await server.videos.get({ id: webVideoId })
 
         expect(video.files).to.have.lengthOf(files.length - 1)
         expect(video.files.find(f => f.id === files[0].id)).to.not.exist
       }
     })
 
-    it('Should delete all webtorrent files', async function () {
+    it('Should delete all web video files', async function () {
       this.timeout(30_000)
 
-      const video = await servers[0].videos.get({ id: webtorrentId })
+      const video = await servers[0].videos.get({ id: webVideoId })
       const files = video.files
 
       for (const file of files) {
-        await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentId, fileId: file.id })
+        await servers[0].videos.removeWebVideoFile({ videoId: webVideoId, fileId: file.id })
       }
 
       await waitJobs(servers)
 
       for (const server of servers) {
-        const video = await server.videos.get({ id: webtorrentId })
+        const video = await server.videos.get({ id: webVideoId })
 
         expect(video.files).to.have.lengthOf(0)
       }
@@ -182,16 +182,16 @@ describe('Test videos files', function () {
     it('Should not delete last file of a video', async function () {
       this.timeout(60_000)
 
-      const webtorrentOnly = await servers[0].videos.get({ id: hlsId })
-      const hlsOnly = await servers[0].videos.get({ id: webtorrentId })
+      const webVideoOnly = await servers[0].videos.get({ id: hlsId })
+      const hlsOnly = await servers[0].videos.get({ id: webVideoId })
 
       for (let i = 0; i < 4; i++) {
-        await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[i].id })
+        await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[i].id })
         await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[i].id })
       }
 
       const expectedStatus = HttpStatusCode.BAD_REQUEST_400
-      await servers[0].videos.removeWebTorrentFile({ videoId: webtorrentOnly.id, fileId: webtorrentOnly.files[4].id, expectedStatus })
+      await servers[0].videos.removeWebVideoFile({ videoId: webVideoOnly.id, fileId: webVideoOnly.files[4].id, expectedStatus })
       await servers[0].videos.removeHLSFile({ videoId: hlsOnly.id, fileId: hlsOnly.streamingPlaylists[0].files[4].id, expectedStatus })
     })
   })
index 30251706b6d74b27b3c4142f78de2b60ad083ced..73c066bfb255696ad4c254ba3080ba2603180b61 100644 (file)
@@ -154,7 +154,7 @@ describe('Test videos filter', function () {
       server: PeerTubeServer
       path: string
       isLocal?: boolean
-      hasWebtorrentFiles?: boolean
+      hasWebVideoFiles?: boolean
       hasHLSFiles?: boolean
       include?: VideoInclude
       privacyOneOf?: VideoPrivacy[]
@@ -174,7 +174,7 @@ describe('Test videos filter', function () {
             'include',
             'category',
             'tagsAllOf',
-            'hasWebtorrentFiles',
+            'hasWebVideoFiles',
             'hasHLSFiles',
             'privacyOneOf',
             'excludeAlreadyWatched'
@@ -463,14 +463,14 @@ describe('Test videos filter', function () {
       }
     })
 
-    it('Should filter by HLS or WebTorrent files', async function () {
+    it('Should filter by HLS or Web Video files', async function () {
       this.timeout(360000)
 
       const finderFactory = (name: string) => (videos: Video[]) => videos.some(v => v.name === name)
 
       await servers[0].config.enableTranscoding(true, false)
-      await servers[0].videos.upload({ attributes: { name: 'webtorrent video' } })
-      const hasWebtorrent = finderFactory('webtorrent video')
+      await servers[0].videos.upload({ attributes: { name: 'web video video' } })
+      const hasWebVideo = finderFactory('web video video')
 
       await waitJobs(servers)
 
@@ -481,24 +481,24 @@ describe('Test videos filter', function () {
       await waitJobs(servers)
 
       await servers[0].config.enableTranscoding(true, true)
-      await servers[0].videos.upload({ attributes: { name: 'hls and webtorrent video' } })
-      const hasBoth = finderFactory('hls and webtorrent video')
+      await servers[0].videos.upload({ attributes: { name: 'hls and web video video' } })
+      const hasBoth = finderFactory('hls and web video video')
 
       await waitJobs(servers)
 
       for (const path of paths) {
         {
-          const videos = await listVideos({ server: servers[0], path, hasWebtorrentFiles: true })
+          const videos = await listVideos({ server: servers[0], path, hasWebVideoFiles: true })
 
-          expect(hasWebtorrent(videos)).to.be.true
+          expect(hasWebVideo(videos)).to.be.true
           expect(hasHLS(videos)).to.be.false
           expect(hasBoth(videos)).to.be.true
         }
 
         {
-          const videos = await listVideos({ server: servers[0], path, hasWebtorrentFiles: false })
+          const videos = await listVideos({ server: servers[0], path, hasWebVideoFiles: false })
 
-          expect(hasWebtorrent(videos)).to.be.false
+          expect(hasWebVideo(videos)).to.be.false
           expect(hasHLS(videos)).to.be.true
           expect(hasBoth(videos)).to.be.false
         }
@@ -506,7 +506,7 @@ describe('Test videos filter', function () {
         {
           const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true })
 
-          expect(hasWebtorrent(videos)).to.be.false
+          expect(hasWebVideo(videos)).to.be.false
           expect(hasHLS(videos)).to.be.true
           expect(hasBoth(videos)).to.be.true
         }
@@ -514,23 +514,23 @@ describe('Test videos filter', function () {
         {
           const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false })
 
-          expect(hasWebtorrent(videos)).to.be.true
+          expect(hasWebVideo(videos)).to.be.true
           expect(hasHLS(videos)).to.be.false
           expect(hasBoth(videos)).to.be.false
         }
 
         {
-          const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false, hasWebtorrentFiles: false })
+          const videos = await listVideos({ server: servers[0], path, hasHLSFiles: false, hasWebVideoFiles: false })
 
-          expect(hasWebtorrent(videos)).to.be.false
+          expect(hasWebVideo(videos)).to.be.false
           expect(hasHLS(videos)).to.be.false
           expect(hasBoth(videos)).to.be.false
         }
 
         {
-          const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true, hasWebtorrentFiles: true })
+          const videos = await listVideos({ server: servers[0], path, hasHLSFiles: true, hasWebVideoFiles: true })
 
-          expect(hasWebtorrent(videos)).to.be.false
+          expect(hasWebVideo(videos)).to.be.false
           expect(hasHLS(videos)).to.be.false
           expect(hasBoth(videos)).to.be.true
         }
index 9882019475bb2b965e82c68aadc5b7314c56028f..c265d7934f0d516276d70d810f283ebca8318349 100644 (file)
@@ -44,8 +44,8 @@ describe('Test studio transcoding in peertube-runner program', function () {
         }
 
         if (objectStorage) {
-          for (const webtorrentFile of video.files) {
-            expectStartWith(webtorrentFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
+          for (const webVideoFile of video.files) {
+            expectStartWith(webVideoFile.fileUrl, objectStorage.getMockWebVideosBaseUrl())
           }
 
           for (const hlsFile of video.streamingPlaylists[0].files) {
index c3f41c097834b84b05826448fb65026853220717..eef6faf4e9e5946685a2766f06b5d142cffc1974 100644 (file)
@@ -24,13 +24,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {
   let peertubeRunner: PeerTubeRunnerProcess
 
   function runSuite (options: {
-    webtorrentEnabled: boolean
+    webVideoEnabled: boolean
     hlsEnabled: boolean
     objectStorage?: ObjectStorageCommand
   }) {
-    const { webtorrentEnabled, hlsEnabled, objectStorage } = options
+    const { webVideoEnabled, hlsEnabled, objectStorage } = options
 
-    const objectStorageBaseUrlWebTorrent = objectStorage
+    const objectStorageBaseUrlWebVideo = objectStorage
       ? objectStorage.getMockWebVideosBaseUrl()
       : undefined
 
@@ -46,13 +46,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {
       await waitJobs(servers, { runnerJobs: true })
 
       for (const server of servers) {
-        if (webtorrentEnabled) {
+        if (webVideoEnabled) {
           await completeWebVideoFilesCheck({
             server,
             originServer: servers[0],
             fixture: 'video_short.mp4',
             videoUUID: uuid,
-            objectStorageBaseUrl: objectStorageBaseUrlWebTorrent,
+            objectStorageBaseUrl: objectStorageBaseUrlWebVideo,
             files: [
               { resolution: 0 },
               { resolution: 144 },
@@ -66,7 +66,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
         if (hlsEnabled) {
           await completeCheckHlsPlaylist({
-            hlsOnly: !webtorrentEnabled,
+            hlsOnly: !webVideoEnabled,
             servers,
             videoUUID: uuid,
             objectStorageBaseUrl: objectStorageBaseUrlHLS,
@@ -84,13 +84,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {
       await waitJobs(servers, { runnerJobs: true })
 
       for (const server of servers) {
-        if (webtorrentEnabled) {
+        if (webVideoEnabled) {
           await completeWebVideoFilesCheck({
             server,
             originServer: servers[0],
             fixture: 'video_short.webm',
             videoUUID: uuid,
-            objectStorageBaseUrl: objectStorageBaseUrlWebTorrent,
+            objectStorageBaseUrl: objectStorageBaseUrlWebVideo,
             files: [
               { resolution: 0 },
               { resolution: 144 },
@@ -104,7 +104,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
         if (hlsEnabled) {
           await completeCheckHlsPlaylist({
-            hlsOnly: !webtorrentEnabled,
+            hlsOnly: !webVideoEnabled,
             servers,
             videoUUID: uuid,
             objectStorageBaseUrl: objectStorageBaseUrlHLS,
@@ -123,13 +123,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {
       await waitJobs(servers, { runnerJobs: true })
 
       for (const server of servers) {
-        if (webtorrentEnabled) {
+        if (webVideoEnabled) {
           await completeWebVideoFilesCheck({
             server,
             originServer: servers[0],
             fixture: 'sample.ogg',
             videoUUID: uuid,
-            objectStorageBaseUrl: objectStorageBaseUrlWebTorrent,
+            objectStorageBaseUrl: objectStorageBaseUrlWebVideo,
             files: [
               { resolution: 0 },
               { resolution: 144 },
@@ -142,7 +142,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
         if (hlsEnabled) {
           await completeCheckHlsPlaylist({
-            hlsOnly: !webtorrentEnabled,
+            hlsOnly: !webVideoEnabled,
             servers,
             videoUUID: uuid,
             objectStorageBaseUrl: objectStorageBaseUrlHLS,
@@ -159,13 +159,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
       await waitJobs(servers, { runnerJobs: true })
 
-      if (webtorrentEnabled) {
+      if (webVideoEnabled) {
         await completeWebVideoFilesCheck({
           server: servers[0],
           originServer: servers[0],
           fixture: 'video_short.mp4',
           videoUUID: uuid,
-          objectStorageBaseUrl: objectStorageBaseUrlWebTorrent,
+          objectStorageBaseUrl: objectStorageBaseUrlWebVideo,
           files: [
             { resolution: 0 },
             { resolution: 144 },
@@ -179,7 +179,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
       if (hlsEnabled) {
         await completeCheckHlsPlaylist({
-          hlsOnly: !webtorrentEnabled,
+          hlsOnly: !webVideoEnabled,
           servers: [ servers[0] ],
           videoUUID: uuid,
           objectStorageBaseUrl: objectStorageBaseUrlHLS,
@@ -203,7 +203,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
 
       await servers[0].config.enableTranscoding(true, true, true)
 
-      await servers[0].videos.runTranscoding({ transcodingType: 'webtorrent', videoId: uuid })
+      await servers[0].videos.runTranscoding({ transcodingType: 'web-video', videoId: uuid })
       await waitJobs(servers, { runnerJobs: true })
 
       await completeWebVideoFilesCheck({
@@ -211,7 +211,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         originServer: servers[0],
         fixture: 'video_short.mp4',
         videoUUID: uuid,
-        objectStorageBaseUrl: objectStorageBaseUrlWebTorrent,
+        objectStorageBaseUrl: objectStorageBaseUrlWebVideo,
         files: [
           { resolution: 0 },
           { resolution: 144 },
@@ -262,7 +262,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(true, false, true)
       })
 
-      runSuite({ webtorrentEnabled: true, hlsEnabled: false })
+      runSuite({ webVideoEnabled: true, hlsEnabled: false })
     })
 
     describe('HLS videos only enabled', function () {
@@ -271,7 +271,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(false, true, true)
       })
 
-      runSuite({ webtorrentEnabled: false, hlsEnabled: true })
+      runSuite({ webVideoEnabled: false, hlsEnabled: true })
     })
 
     describe('Web video & HLS enabled', function () {
@@ -280,7 +280,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(true, true, true)
       })
 
-      runSuite({ webtorrentEnabled: true, hlsEnabled: true })
+      runSuite({ webVideoEnabled: true, hlsEnabled: true })
     })
   })
 
@@ -306,7 +306,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(true, false, true)
       })
 
-      runSuite({ webtorrentEnabled: true, hlsEnabled: false, objectStorage })
+      runSuite({ webVideoEnabled: true, hlsEnabled: false, objectStorage })
     })
 
     describe('HLS videos only enabled', function () {
@@ -315,7 +315,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(false, true, true)
       })
 
-      runSuite({ webtorrentEnabled: false, hlsEnabled: true, objectStorage })
+      runSuite({ webVideoEnabled: false, hlsEnabled: true, objectStorage })
     })
 
     describe('Web video & HLS enabled', function () {
@@ -324,7 +324,7 @@ describe('Test VOD transcoding in peertube-runner program', function () {
         await servers[0].config.enableTranscoding(true, true, true)
       })
 
-      runSuite({ webtorrentEnabled: true, hlsEnabled: true, objectStorage })
+      runSuite({ webVideoEnabled: true, hlsEnabled: true, objectStorage })
     })
 
     after(async function () {
index e951a1299c02bc92a30e2f1fed33a8dbcf0a4cb8..f5a0cbe85fdda7f9480ebc027f36f07f79cabc97 100644 (file)
@@ -302,11 +302,11 @@ describe('Test plugin helpers', function () {
 
       // Video files check
       {
-        expect(body.webtorrent.videoFiles).to.be.an('array')
+        expect(body.webVideo.videoFiles).to.be.an('array')
         expect(body.hls.videoFiles).to.be.an('array')
 
         for (const resolution of [ 144, 240, 360, 480, 720 ]) {
-          for (const files of [ body.webtorrent.videoFiles, body.hls.videoFiles ]) {
+          for (const files of [ body.webVideo.videoFiles, body.hls.videoFiles ]) {
             const file = files.find(f => f.resolution === resolution)
             expect(file).to.exist
 
@@ -318,7 +318,7 @@ describe('Test plugin helpers', function () {
           }
         }
 
-        videoPath = body.webtorrent.videoFiles[0].path
+        videoPath = body.webVideo.videoFiles[0].path
       }
 
       // Thumbnails check
index 689eec5acdb3baafdf0b3475fb9d12c7b6684176..f3d929426cfe23e372e9366b772a4b768e48f221 100644 (file)
@@ -247,7 +247,7 @@ describe('Test transcoding plugins', function () {
 
       const video = await server.videos.get({ id: videoUUID })
 
-      const path = server.servers.buildWebTorrentFilePath(video.files[0].fileUrl)
+      const path = server.servers.buildWebVideoFilePath(video.files[0].fileUrl)
       const audioProbe = await getAudioStream(path)
       expect(audioProbe.audioStream.codec_name).to.equal('opus')
 
index 0bd16182018ceb95f54df39fe88e5b215b19711f..6cba5b14c431a4aa1b81b88e1db855a8033592d7 100644 (file)
@@ -215,22 +215,22 @@ async function checkVideoFilesWereRemoved (options: {
 }) {
   const { video, server, captions = [], onlyVideoFiles = false } = options
 
-  const webtorrentFiles = video.files || []
+  const webVideoFiles = video.files || []
   const hlsFiles = video.streamingPlaylists[0]?.files || []
 
   const thumbnailName = basename(video.thumbnailPath)
   const previewName = basename(video.previewPath)
 
-  const torrentNames = webtorrentFiles.concat(hlsFiles).map(f => basename(f.torrentUrl))
+  const torrentNames = webVideoFiles.concat(hlsFiles).map(f => basename(f.torrentUrl))
 
   const captionNames = captions.map(c => basename(c.captionPath))
 
-  const webtorrentFilenames = webtorrentFiles.map(f => basename(f.fileUrl))
+  const webVideoFilenames = webVideoFiles.map(f => basename(f.fileUrl))
   const hlsFilenames = hlsFiles.map(f => basename(f.fileUrl))
 
   let directories: { [ directory: string ]: string[] } = {
-    videos: webtorrentFilenames,
-    redundancy: webtorrentFilenames,
+    videos: webVideoFilenames,
+    redundancy: webVideoFilenames,
     [join('playlists', 'hls')]: hlsFilenames,
     [join('redundancy', 'hls')]: hlsFilenames
   }
index fd6c760b23de6fb212047b22d72076a5468a20da..c24eb5233b7e29490cec26c994d491948b63f6d4 100644 (file)
@@ -65,19 +65,19 @@ async function listRedundanciesCLI (target: VideoRedundanciesTarget) {
   }) as any
 
   for (const redundancy of data) {
-    const webtorrentFiles = redundancy.redundancies.files
+    const webVideoFiles = redundancy.redundancies.files
     const streamingPlaylists = redundancy.redundancies.streamingPlaylists
 
     let totalSize = ''
     if (target === 'remote-videos') {
-      const tmp = webtorrentFiles.concat(streamingPlaylists)
+      const tmp = webVideoFiles.concat(streamingPlaylists)
                                  .reduce((a, b) => a + b.size, 0)
 
       totalSize = bytes(tmp)
     }
 
     const instances = uniqify(
-      webtorrentFiles.concat(streamingPlaylists)
+      webVideoFiles.concat(streamingPlaylists)
                      .map(r => r.fileUrl)
                      .map(u => new URL(u).host)
     )
@@ -86,7 +86,7 @@ async function listRedundanciesCLI (target: VideoRedundanciesTarget) {
       redundancy.id.toString(),
       redundancy.name,
       redundancy.url,
-      webtorrentFiles.length,
+      webVideoFiles.length,
       streamingPlaylists.length,
       instances.join('\n'),
       totalSize
index 55603e59c6671247d30b17871ce1818fd329d56a..68106788d3c579a9160edb72fd48ec96725cea17 100644 (file)
@@ -38,6 +38,6 @@ export function isStreamingPlaylistFile (file: any): file is MVideoFileStreaming
   return !!file.videoStreamingPlaylistId
 }
 
-export function isWebtorrentFile (file: any): file is MVideoFileVideo {
+export function isWebVideoFile (file: any): file is MVideoFileVideo {
   return !!file.videoId
 }
index df419fff47239576630c6f7dffcc2dc4e58f3379..103ef234b09ee0c384bb35a761b6543ba903145e 100644 (file)
@@ -41,7 +41,17 @@ export type PeerTubeHelpers = {
     ffprobe: (path: string) => Promise<any>
 
     getFiles: (id: number | string) => Promise<{
-      webtorrent: {
+      webtorrent: { // TODO: remove in v7
+        videoFiles: {
+          path: string // Could be null if using remote storage
+          url: string
+          resolution: number
+          size: number
+          fps: number
+        }[]
+      }
+
+      webVideo: {
         videoFiles: {
           path: string // Could be null if using remote storage
           url: string
index da479c928b2407b50e9ad5d06c86954d6360ea31..2c52ca8cf46a17af9c61dc191af861eb36c22fce 100644 (file)
@@ -30,7 +30,9 @@ export interface VideosCommonQuery {
   tagsAllOf?: string[]
 
   hasHLSFiles?: boolean
-  hasWebtorrentFiles?: boolean
+
+  hasWebtorrentFiles?: boolean // TODO: remove in v7
+  hasWebVideoFiles?: boolean
 
   skipCount?: boolean
 
index 9c40079fbf7fdecb1ae938d46846df49a4017089..c14806dabb70c935680f7309af9e834c98b43cfa 100644 (file)
@@ -148,17 +148,17 @@ export interface HLSTranscodingPayload extends BaseTranscodingPayload {
   fps: number
   copyCodecs: boolean
 
-  deleteWebTorrentFiles: boolean
+  deleteWebVideoFiles: boolean
 }
 
-export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
-  type: 'new-resolution-to-webtorrent'
+export interface NewWebVideoResolutionTranscodingPayload extends BaseTranscodingPayload {
+  type: 'new-resolution-to-web-video'
   resolution: VideoResolution
   fps: number
 }
 
 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
-  type: 'merge-audio-to-webtorrent'
+  type: 'merge-audio-to-web-video'
 
   resolution: VideoResolution
   fps: number
@@ -167,7 +167,7 @@ export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
 }
 
 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
-  type: 'optimize-to-webtorrent'
+  type: 'optimize-to-web-video'
 
   quickTranscode: boolean
 
@@ -176,7 +176,7 @@ export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
 
 export type VideoTranscodingPayload =
   HLSTranscodingPayload
-  | NewWebTorrentResolutionTranscodingPayload
+  | NewWebVideoResolutionTranscodingPayload
   | OptimizeTranscodingPayload
   | MergeAudioTranscodingPayload
 
index f3cceb5f2699aaf0f0eaa3ce34df07dcf4a4e8fd..c1d5ffba4e34a8fe194bfdac2b804a544e6d466f 100644 (file)
@@ -5,8 +5,6 @@ export interface UserUpdateMe {
   description?: string
   nsfwPolicy?: NSFWPolicyType
 
-  // FIXME: deprecated in favour of p2pEnabled in 4.1
-  webTorrentEnabled?: boolean
   p2pEnabled?: boolean
 
   autoPlayVideo?: boolean
index 0761c1e3278987a8e670c0655dd9f64d930d4235..9de4118b42bae39d4cab54b0d454ed2490787079 100644 (file)
@@ -22,8 +22,6 @@ export interface User {
   autoPlayNextVideo: boolean
   autoPlayNextVideoPlaylist: boolean
 
-  // @deprecated in favour of p2pEnabled
-  webTorrentEnabled: boolean
   p2pEnabled: boolean
 
   videosHistoryEnabled: boolean
index aeb393e57d73c82b2da85273dd086fd7dba9d80c..c6e756a0a630d924db0d9788e1f293800807a800 100644 (file)
@@ -1,3 +1,3 @@
 export interface VideoTranscodingCreate {
-  transcodingType: 'hls' | 'webtorrent'
+  transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7
 }
index 114db80916efd5035aba814530db1b53794f399a..00dc8e11cd1e3e7aa459d1c0e362b366891a212f 100644 (file)
@@ -131,7 +131,7 @@ export class ConfigCommand extends AbstractCommand {
   }
 
   // TODO: convert args to object
-  enableTranscoding (webtorrent = true, hls = true, with0p = false) {
+  enableTranscoding (webVideo = true, hls = true, with0p = false) {
     return this.updateExistingSubConfig({
       newConfig: {
         transcoding: {
@@ -143,7 +143,7 @@ export class ConfigCommand extends AbstractCommand {
           resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p),
 
           webtorrent: {
-            enabled: webtorrent
+            enabled: webVideo
           },
           hls: {
             enabled: hls
@@ -154,7 +154,7 @@ export class ConfigCommand extends AbstractCommand {
   }
 
   // TODO: convert args to object
-  enableMinimumTranscoding (webtorrent = true, hls = true) {
+  enableMinimumTranscoding (webVideo = true, hls = true) {
     return this.updateExistingSubConfig({
       newConfig: {
         transcoding: {
@@ -170,7 +170,7 @@ export class ConfigCommand extends AbstractCommand {
           },
 
           webtorrent: {
-            enabled: webtorrent
+            enabled: webVideo
           },
           hls: {
             enabled: hls
index 19645cb93a1eae15e82389a9ff4a014d4b351024..4e66a900c0eae8a3d8910b77227c5354d5a5e511 100644 (file)
@@ -77,7 +77,7 @@ export class ServersCommand extends AbstractCommand {
     return join(root(), 'test' + this.server.internalServerNumber, directory)
   }
 
-  buildWebTorrentFilePath (fileUrl: string) {
+  buildWebVideoFilePath (fileUrl: string) {
     return this.buildDirectory(join('videos', basename(fileUrl)))
   }
 
index 93ca623e1abb426ebaaed7a184399772f70d067c..9602fa7dac655627423e78bdd54397d8dc48d637 100644 (file)
@@ -686,10 +686,10 @@ export class VideosCommand extends AbstractCommand {
     })
   }
 
-  removeAllWebTorrentFiles (options: OverrideCommandOptions & {
+  removeAllWebVideoFiles (options: OverrideCommandOptions & {
     videoId: number | string
   }) {
-    const path = '/api/v1/videos/' + options.videoId + '/webtorrent'
+    const path = '/api/v1/videos/' + options.videoId + '/web-videos'
 
     return this.deleteRequest({
       ...options,
@@ -700,11 +700,11 @@ export class VideosCommand extends AbstractCommand {
     })
   }
 
-  removeWebTorrentFile (options: OverrideCommandOptions & {
+  removeWebVideoFile (options: OverrideCommandOptions & {
     videoId: number | string
     fileId: number
   }) {
-    const path = '/api/v1/videos/' + options.videoId + '/webtorrent/' + options.fileId
+    const path = '/api/v1/videos/' + options.videoId + '/web-videos/' + options.fileId
 
     return this.deleteRequest({
       ...options,
@@ -717,7 +717,7 @@ export class VideosCommand extends AbstractCommand {
 
   runTranscoding (options: OverrideCommandOptions & {
     videoId: number | string
-    transcodingType: 'hls' | 'webtorrent'
+    transcodingType: 'hls' | 'webtorrent' | 'web-video'
   }) {
     const path = '/api/v1/videos/' + options.videoId + '/transcoding'
 
index 493268c6ec5031dc837caa4a074792de0bec6fae..fd5507e387c0b397121affd5bb3939b79a74e876 100644 (file)
@@ -146,7 +146,7 @@ Value must be a valid color (`red` or `rgba(100, 100, 100, 0.5)`).
 
 Force a specific player engine.
 
-Value must be a valid mode (`webtorrent` or `p2p-media-loader`).
+Value must be a valid mode (`web-video` or `p2p-media-loader`).
 
 ### api
 
index edf9990e378c05ef058ef85c28349df7660aaf58..e1a21fb5c8fa6faee57224ee65192f6388d05058 100644 (file)
@@ -370,7 +370,7 @@ paths:
     get:
       tags:
         - Static Video Files
-      summary: Get public WebTorrent video file
+      summary: Get public Web Video file
       parameters:
         - $ref: '#/components/parameters/staticFilename'
       responses:
@@ -382,7 +382,7 @@ paths:
     get:
       tags:
         - Static Video Files
-      summary: Get private WebTorrent video file
+      summary: Get private Web Video video file
       parameters:
         - $ref: '#/components/parameters/staticFilename'
         - $ref: '#/components/parameters/videoFileToken'
@@ -574,7 +574,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
       responses:
         '200':
           description: successful operation
@@ -658,7 +658,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
       responses:
         '200':
           description: successful operation
@@ -748,7 +748,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -918,7 +918,7 @@ paths:
           description: >
             Arises when:
               - the emailer is disabled and the instance is open to registrations
-              - webtorrent and hls are disabled with transcoding enabled - you need at least one enabled
+              - web videos and hls are disabled with transcoding enabled - you need at least one enabled
     delete:
       summary: Delete instance runtime configuration
       operationId: delCustomConfig
@@ -1873,7 +1873,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -2418,7 +2418,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -3799,7 +3799,7 @@ paths:
               type: object
               properties:
                 passwords:
-                  $ref: '#/components/schemas/AddVideoPasswords' 
+                  $ref: '#/components/schemas/AddVideoPasswords'
       responses:
         '204':
           description: successful operation
@@ -3933,7 +3933,7 @@ paths:
         - $ref: '#/components/parameters/include'
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -4804,15 +4804,15 @@ paths:
           description: successful operation
         '404':
           description: video does not exist
-  '/api/v1/videos/{id}/webtorrent':
+  '/api/v1/videos/{id}/web-videos':
     delete:
-      summary: Delete video WebTorrent files
+      summary: Delete video Web Video files
       security:
         - OAuth2:
           - admin
       tags:
         - Video Files
-      operationId: delVideoWebTorrent
+      operationId: delVideoWebVideos
       parameters:
         - $ref: '#/components/parameters/idOrUUID'
       responses:
@@ -4842,7 +4842,7 @@ paths:
                     type: string
                     enum:
                       - hls
-                      - webtorrent
+                      - web-video
                 required:
                   - transcodingType
       responses:
@@ -4880,7 +4880,7 @@ paths:
         - $ref: '#/components/parameters/privacyOneOf'
         - $ref: '#/components/parameters/uuids'
         - $ref: '#/components/parameters/hasHLSFiles'
-        - $ref: '#/components/parameters/hasWebtorrentFiles'
+        - $ref: '#/components/parameters/hasWebVideoFiles'
         - $ref: '#/components/parameters/skipCount'
         - $ref: '#/components/parameters/start'
         - $ref: '#/components/parameters/count'
@@ -6471,13 +6471,13 @@ components:
       schema:
         type: boolean
       description: '**PeerTube >= 4.0** Display only videos that have HLS files'
-    hasWebtorrentFiles:
-      name: hasWebtorrentFiles
+    hasWebVideoFiles:
+      name: hasWebVideoFiles
       in: query
       required: false
       schema:
         type: boolean
-      description: '**PeerTube >= 4.0** Display only videos that have WebTorrent files'
+      description: '**PeerTube >= 4.0** Display only videos that have Web Video files'
     privacyOneOf:
       name: privacyOneOf
       in: query
@@ -7222,7 +7222,7 @@ components:
               items:
                 $ref: '#/components/schemas/VideoFile'
               description: |
-                WebTorrent/raw video files. If WebTorrent is disabled on the server:
+                Web compatible video files. If Web Video is disabled on the server:
 
                 - field will be empty
                 - video files will be found in `streamingPlaylists[].files` field
@@ -8136,13 +8136,13 @@ components:
                   type: boolean
             webtorrent:
               type: object
-              description: WebTorrent-specific settings
+              description: Web Video specific settings
               properties:
                 enabled:
                   type: boolean
             hls:
               type: object
-              description: HLS-specific settings
+              description: HLS specific settings
               properties:
                 enabled:
                   type: boolean
@@ -9521,7 +9521,7 @@ components:
           type: string
           enum:
             - 'p2p-media-loader'
-            - 'webtorrent'
+            - 'web-video'
         resolution:
           type: number
           description: Current player video resolution
@@ -9753,7 +9753,7 @@ components:
         password:
           type: string
           minLength: 2
-        videoId: 
+        videoId:
           $ref: '#/components/schemas/id'
     VideoPasswordList:
       properties:
index 0c08cd2006c6ebad60beddfd1111f247ccb3126c..d30ff56b316a966a652378f8fd3c5b74c191598e 100644 (file)
@@ -227,7 +227,7 @@ docker-compose exec -u peertube peertube npm run regenerate-thumbnails
 
 ### create-import-video-file-job.js
 
-You can use this script to import a video file to replace an already uploaded file or to add a new webtorrent resolution to a video. PeerTube needs to be running.
+You can use this script to import a video file to replace an already uploaded file or to add a new web compatible resolution to a video. PeerTube needs to be running.
 You can then create a transcoding job using the web interface if you need to optimize your file or create an HLS version of it.
 
 ```bash