ActivityPub-federated video streaming platform using P2P directly in your web browser
Prefer web videos in favour of webtorrent
Chocobozzz784e2ad5c34b
diff --git a/README.md b/README.mdindex 0c2989c62f..09585aa15c 100644--- 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>).diff --git a/client/e2e/src/suites-all/private-videos.e2e-spec.ts b/client/e2e/src/suites-all/private-videos.e2e-spec.tsindex a25208bb3a..829d76a841 100644--- a/client/e2e/src/suites-all/private-videos.e2e-spec.ts+++ b/client/e2e/src/suites-all/private-videos.e2e-spec.ts@@ -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)diff --git a/client/e2e/src/suites-all/videos.e2e-spec.ts b/client/e2e/src/suites-all/videos.e2e-spec.tsindex d1ab9aef3d..5d0f8c152b 100644--- a/client/e2e/src/suites-all/videos.e2e-spec.ts+++ b/client/e2e/src/suites-all/videos.e2e-spec.ts@@ -89,7 +89,7 @@ describe('Videos all workflow', () => {let videoNameToExcept = videoNameif (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()) returnconst accessToken = await browser.execute(`return window.localStorage.getItem('access_token');`)diff --git a/client/e2e/src/utils/urls.ts b/client/e2e/src/utils/urls.tsindex cc0bdfbff3..eafe0aa5df 100644--- a/client/e2e/src/utils/urls.ts+++ b/client/e2e/src/utils/urls.ts@@ -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',diff --git a/client/e2e/wdio.local-test.conf.ts b/client/e2e/wdio.local-test.conf.tsindex 96ddc67cac..6c01713726 100644--- a/client/e2e/wdio.local-test.conf.ts+++ b/client/e2e/wdio.local-test.conf.ts@@ -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}diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.htmlindex fb750aca6b..7218511a9c 100644--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html@@ -71,7 +71,7 @@<div class="form-group" [ngClass]="getTranscodingDisabledClass()"><my-peertube-checkboxinputName="transcodingWebTorrentEnabled" formControlName="enabled"- i18n-labelText labelText="WebTorrent enabled"+ i18n-labelText labelText="Web Videos enabled"><ng-template ptTemplate="help"><ng-container>@@ -93,14 +93,14 @@<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>diff --git a/client/src/app/+admin/overview/videos/video-admin.service.ts b/client/src/app/+admin/overview/videos/video-admin.service.tsindex 195b265a1f..7224957068 100644--- a/client/src/app/+admin/overview/videos/video-admin.service.ts+++ b/client/src/app/+admin/overview/videos/video-admin.service.ts@@ -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: {diff --git a/client/src/app/+admin/overview/videos/video-list.component.html b/client/src/app/+admin/overview/videos/video-list.component.htmlindex c4f78cadc7..3a4666435c 100644--- a/client/src/app/+admin/overview/videos/video-list.component.html+++ b/client/src/app/+admin/overview/videos/video-list.component.html@@ -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>@@ -102,8 +102,8 @@<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">@@ -112,13 +112,13 @@<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>diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.tsindex e9c5261937..52f02d8d04 100644--- a/client/src/app/+admin/overview/videos/video-list.component.ts+++ b/client/src/app/+admin/overview/videos/video-list.component.ts@@ -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 falsereturn 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: stringif (type === 'hls') {@@ -274,7 +274,7 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {} else {// eslint-disable-next-line max-lenmessage = 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: () => {diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.tsindex d57608f1c6..5aa02e472b 100644--- a/client/src/app/core/users/user.model.ts+++ b/client/src/app/core/users/user.model.ts@@ -30,8 +30,6 @@ export class User implements UserServerModel {autoPlayNextVideoPlaylist: booleanp2pEnabled: boolean- // FIXME: deprecated in 4.1- webTorrentEnabled: nevervideosHistoryEnabled: booleanvideoLanguages: string[]diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.tsindex e94087dbe3..1ffc404112 100644--- a/client/src/app/shared/shared-main/video/video.model.ts+++ b/client/src/app/shared/shared-main/video/video.model.ts@@ -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}diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.tsindex 4e8b84dfc9..20145b9c5a 100644--- a/client/src/app/shared/shared-main/video/video.service.ts+++ b/client/src/app/shared/shared-main/video/video.service.ts@@ -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)diff --git a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.tsindex 56527ddfaf..0a3ada7113 100644--- a/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts@@ -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'}diff --git a/config/default.yaml b/config/default.yamlindex e54c93ac52..6f78fb7e92 100644--- a/config/default.yaml+++ b/config/default.yaml@@ -201,7 +201,7 @@ object_storage:# Useful when you want to use a CDN/external proxybase_url: '' # Example: 'https://mirror.example.com'- # Same settings but for webtorrent videos+ # Same settings but for web videosvideos:bucket_name: 'videos'prefix: ''@@ -480,18 +480,18 @@ transcoding:# Transcode and keep original resolution, even if it's above your maximum enabled resolutionalways_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.1webtorrent: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 2hls:enabled: truediff --git a/config/production.yaml.example b/config/production.yaml.exampleindex 83ee48daed..2898a45ac7 100644--- a/config/production.yaml.example+++ b/config/production.yaml.example@@ -199,7 +199,7 @@ object_storage:# Useful when you want to use a CDN/external proxybase_url: '' # Example: 'https://mirror.example.com'- # Same settings but for webtorrent videos+ # Same settings but for web videosvideos:bucket_name: 'videos'prefix: ''@@ -490,18 +490,18 @@ transcoding:# Transcode and keep original resolution, even if it's above your maximum enabled resolutionalways_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.1webtorrent: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 2hls:enabled: true@@ -599,7 +599,6 @@ video_studio:# If enabled, users can create transcoding tasks as they wishenabled: 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 videosdiff --git a/scripts/prune-storage.ts b/scripts/prune-storage.tsindex d19594a60e..8d1ded59bb 100755--- a/scripts/prune-storage.ts+++ b/scripts/prune-storage.ts@@ -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 directoryif (filePath === DIRECTORIES.VIDEOS.PRIVATE) return true- return VideoFileModel.doesOwnedWebTorrentVideoFileExist(basename(filePath))+ return VideoFileModel.doesOwnedWebVideoFileExist(basename(filePath))}}diff --git a/server/controllers/api/runners/jobs-files.ts b/server/controllers/api/runners/jobs-files.tsindex 4e69fb9023..cb4eff570c 100644--- a/server/controllers/api/runners/jobs-files.ts+++ b/server/controllers/api/runners/jobs-files.ts@@ -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.filenamediff --git a/server/controllers/api/users/me.ts b/server/controllers/api/users/me.tsindex 218091d916..4753308e8b 100644--- a/server/controllers/api/users/me.ts+++ b/server/controllers/api/users/me.ts@@ -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.emaildiff --git a/server/controllers/api/videos/files.ts b/server/controllers/api/videos/files.tsindex 6d9c0b843a..67b60ff639 100644--- a/server/controllers/api/videos/files.ts+++ b/server/controllers/api/videos/files.ts@@ -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 V7authenticate,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 V7authenticate,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.videoAllconst 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)diff --git a/server/controllers/object-storage-proxy.ts b/server/controllers/object-storage-proxy.tsindex 8e2cc4af98..0edde64fe9 100644--- a/server/controllers/object-storage-proxy.ts+++ b/server/controllers/object-storage-proxy.ts@@ -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) {diff --git a/server/controllers/static.ts b/server/controllers/static.tsindex bbd0dd0119..5ce739bfc3 100644--- a/server/controllers/static.ts+++ b/server/controllers/static.ts@@ -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)diff --git a/server/helpers/custom-validators/metrics.ts b/server/helpers/custom-validators/metrics.tsindex 533f8988d9..44a863630a 100644--- a/server/helpers/custom-validators/metrics.ts+++ b/server/helpers/custom-validators/metrics.ts@@ -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'}// ---------------------------------------------------------------------------diff --git a/server/helpers/custom-validators/video-transcoding.ts b/server/helpers/custom-validators/video-transcoding.tsindex cf792f9964..220530de42 100644--- a/server/helpers/custom-validators/video-transcoding.ts+++ b/server/helpers/custom-validators/video-transcoding.ts@@ -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}// ---------------------------------------------------------------------------diff --git a/server/helpers/query.ts b/server/helpers/query.tsindex 10efae41cf..c0f78368fc 100644--- a/server/helpers/query.ts+++ b/server/helpers/query.ts@@ -23,7 +23,8 @@ function pickCommonVideoQuery (query: VideosCommonQueryAfterSanitize) {'include','skipCount','hasHLSFiles',- 'hasWebtorrentFiles',+ 'hasWebtorrentFiles', // TODO: Remove in v7+ 'hasWebVideoFiles','search','excludeAlreadyWatched'])diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.tsindex 68dea909d2..21bc5911cd 100644--- a/server/initializers/checker-after-init.ts+++ b/server/initializers/checker-after-init.ts@@ -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) {diff --git a/server/lib/activitypub/videos/shared/abstract-builder.ts b/server/lib/activitypub/videos/shared/abstract-builder.tsindex 8b6a7fd754..98c2f58eb4 100644--- a/server/lib/activitypub/videos/shared/abstract-builder.ts+++ b/server/lib/activitypub/videos/shared/abstract-builder.ts@@ -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))diff --git a/server/lib/activitypub/videos/shared/creator.ts b/server/lib/activitypub/videos/shared/creator.tsindex 3d646ef66e..bc139e4faf 100644--- a/server/lib/activitypub/videos/shared/creator.ts+++ b/server/lib/activitypub/videos/shared/creator.ts@@ -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)diff --git a/server/lib/activitypub/videos/updater.ts b/server/lib/activitypub/videos/updater.tsindex c98bce6622..522d7b0438 100644--- a/server/lib/activitypub/videos/updater.ts+++ b/server/lib/activitypub/videos/updater.ts@@ -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)})diff --git a/server/lib/job-queue/handlers/move-to-object-storage.ts b/server/lib/job-queue/handlers/move-to-object-storage.tsindex 26752ff37d..9a99b67227 100644--- a/server/lib/job-queue/handlers/move-to-object-storage.ts+++ b/server/lib/job-queue/handlers/move-to-object-storage.ts@@ -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 })diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.tsindex 9a4550e4de..d221e89680 100644--- a/server/lib/job-queue/handlers/video-file-import.ts+++ b/server/lib/job-queue/handlers/video-file-import.ts@@ -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 arrayvideo.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,diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.tsindex 436bf31759..e5cd258d62 100644--- a/server/lib/job-queue/handlers/video-import.ts+++ b/server/lib/job-queue/handlers/video-import.ts@@ -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: MVidextname: fileExt,resolution,size: stats.size,- filename: generateWebTorrentVideoFilename(resolution, fileExt),+ filename: generateWebVideoFilename(resolution, fileExt),fps,videoId: videoImport.videoId}diff --git a/server/lib/job-queue/handlers/video-transcoding.ts b/server/lib/job-queue/handlers/video-transcoding.tsindex f8758f1702..1c8f4fd9f4 100644--- a/server/lib/job-queue/handlers/video-transcoding.ts+++ b/server/lib/job-queue/handlers/video-transcoding.ts@@ -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: MVideconst 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: MergeAudioTransawait 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 })diff --git a/server/lib/object-storage/keys.ts b/server/lib/object-storage/keys.tsindex 4f17073f48..6d2098298d 100644--- a/server/lib/object-storage/keys.ts+++ b/server/lib/object-storage/keys.ts@@ -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}diff --git a/server/lib/object-storage/pre-signed-urls.ts b/server/lib/object-storage/pre-signed-urls.tsindex d8473d01e3..313654a574 100644--- a/server/lib/object-storage/pre-signed-urls.ts+++ b/server/lib/object-storage/pre-signed-urls.ts@@ -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: {diff --git a/server/lib/object-storage/proxy.ts b/server/lib/object-storage/proxy.tsindex c782a8a250..c09a0d1b07 100644--- a/server/lib/object-storage/proxy.ts+++ b/server/lib/object-storage/proxy.ts@@ -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.Requestres: express.Responsefilename: 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')})diff --git a/server/lib/object-storage/urls.ts b/server/lib/object-storage/urls.tsindex b8ef94559a..84bc1f6c09 100644--- a/server/lib/object-storage/urls.ts+++ b/server/lib/object-storage/urls.ts@@ -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_URLif (!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}diff --git a/server/lib/object-storage/videos.ts b/server/lib/object-storage/videos.tsindex 9152c53529..300c1f7e17 100644--- a/server/lib/object-storage/videos.ts+++ b/server/lib/object-storage/videos.ts@@ -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, filenamereturn 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: stringrangeHeader: 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}diff --git a/server/lib/paths.ts b/server/lib/paths.tsindex 470970f55f..db1cdede2d 100644--- a/server/lib/paths.ts+++ b/server/lib/paths.ts@@ -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,diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.tsindex d235f52c08..b4e3eece48 100644--- a/server/lib/plugins/plugin-helpers-builder.ts+++ b/server/lib/plugins/plugin-helpers-builder.ts@@ -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: {diff --git a/server/lib/runners/job-handlers/shared/vod-helpers.ts b/server/lib/runners/job-handlers/shared/vod-helpers.tsindex 93ae89ff87..1a2ad02ca0 100644--- a/server/lib/runners/job-handlers/shared/vod-helpers.ts+++ b/server/lib/runners/job-handlers/shared/vod-helpers.ts@@ -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: newVideoFilePathdiff --git a/server/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts b/server/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.tsindex 5f247d7929..905007db93 100644--- a/server/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts+++ b/server/lib/runners/job-handlers/vod-audio-merge-transcoding-job-handler.ts@@ -83,7 +83,7 @@ export class VODAudioMergeTranscodingJobHandler extends AbstractVODTranscodingJo// We can remove the old audio fileconst oldAudioFile = video.VideoFiles[0]- await video.removeWebTorrentFile(oldAudioFile)+ await video.removeWebVideoFile(oldAudioFile)await oldAudioFile.destroy()video.VideoFiles = []diff --git a/server/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts b/server/lib/runners/job-handlers/vod-hls-transcoding-job-handler.tsindex cc94bcbda0..02845952cb 100644--- a/server/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts+++ b/server/lib/runners/job-handlers/vod-hls-transcoding-job-handler.ts@@ -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 AbstractVODTranscodingJobHandleif (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))diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.tsindex dc450c338d..24d340a734 100644--- a/server/lib/schedulers/videos-redundancy-scheduler.ts+++ b/server/lib/schedulers/videos-redundancy-scheduler.ts@@ -23,7 +23,7 @@ import { getLocalVideoCacheFileActivityPubUrl, getLocalVideoCacheStreamingPlayliimport { 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.iddiff --git a/server/lib/transcoding/create-transcoding-job.ts b/server/lib/transcoding/create-transcoding-job.tsindex abe32684de..d78e68b873 100644--- a/server/lib/transcoding/create-transcoding-job.ts+++ b/server/lib/transcoding/create-transcoding-job.ts@@ -15,7 +15,7 @@ export function createOptimizeOrMergeAudioJobs (options: {// ---------------------------------------------------------------------------export function createTranscodingJobs (options: {- transcodingType: 'hls' | 'webtorrent'+ transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7video: MVideoFullLightresolutions: number[]isNewVideo: booleandiff --git a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts b/server/lib/transcoding/shared/job-builders/abstract-job-builder.tsindex 80dc05bfb6..15fc814ae3 100644--- a/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts+++ b/server/lib/transcoding/shared/job-builders/abstract-job-builder.ts@@ -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 v7video: MVideoFullLightresolutions: number[]isNewVideo: booleandiff --git a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.tsindex 4f802e2a67..2ecd57249d 100644--- a/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts+++ b/server/lib/transcoding/shared/job-builders/transcoding-job-queue-builder.ts@@ -12,7 +12,7 @@ import { ffprobePromise, getVideoStreamDimensionsInfo, getVideoStreamFPS, hasAudimport {HLSTranscodingPayload,MergeAudioTranscodingPayload,- NewWebTorrentResolutionTranscodingPayload,+ NewWebVideoResolutionTranscodingPayload,OptimizeTranscodingPayload,VideoTranscodingPayload} from '@shared/models'@@ -33,7 +33,7 @@ export class TranscodingJobQueueBuilder extends AbstractJobBuilder {const { video, videoFile, isNewVideo, user, videoFileAlreadyLocked } = optionslet 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 itcopyCodecs: !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 v7video: MVideoFullLightresolutions: 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: numberfps: numberisNewVideo: boolean- deleteWebTorrentFiles?: boolean // default false+ deleteWebVideoFiles?: boolean // default falsecopyCodecs?: boolean // default false}): HLSTranscodingPayload {- const { videoUUID, resolution, fps, isNewVideo, deleteWebTorrentFiles = false, copyCodecs = false } = options+ const { videoUUID, resolution, fps, isNewVideo, deleteWebVideoFiles = false, copyCodecs = false } = optionsreturn {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: stringresolution: numberfps: numberisNewVideo: boolean- }): NewWebTorrentResolutionTranscodingPayload {+ }): NewWebVideoResolutionTranscodingPayload {const { videoUUID, resolution, fps, isNewVideo } = optionsreturn {- 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 } = optionsreturn {- 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 } = optionsreturn {- type: 'optimize-to-webtorrent',+ type: 'optimize-to-web-video',videoUUID,isNewVideo,hasChildren,diff --git a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.tsindex 4b8bc2f3de..b98172c2df 100644--- a/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts+++ b/server/lib/transcoding/shared/job-builders/transcoding-runner-job-builder.ts@@ -89,7 +89,7 @@ export class TranscodingRunnerJobBuilder extends AbstractJobBuilder {// ---------------------------------------------------------------------------async createTranscodingJobs (options: {- transcodingType: 'hls' | 'webtorrent'+ transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7video: MVideoFullLightresolutions: 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,diff --git a/server/lib/transcoding/web-transcoding.ts b/server/lib/transcoding/web-transcoding.tsindex a499db422a..f92d457a09 100644--- a/server/lib/transcoding/web-transcoding.ts+++ b/server/lib/transcoding/web-transcoding.ts@@ -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 filenameinputVideoFile.resolution = resolutioninputVideoFile.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: MVideoFullLightresolution: VideoResolutionfps: 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 extensioninputVideoFile.extname = newExtnameinputVideoFile.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/5456video.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: MVideoFullLightvideoFile: MVideoFilevideoOutputPath: 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')diff --git a/server/lib/video-file.ts b/server/lib/video-file.tsindex 88d48c945d..46af67ccd3 100644--- a/server/lib/video-file.ts+++ b/server/lib/video-file.ts@@ -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.VideoFilesif (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}diff --git a/server/lib/video-path-manager.ts b/server/lib/video-path-manager.tsindex 9953cae5de..133544bb22 100644--- a/server/lib/video-path-manager.ts+++ b/server/lib/video-path-manager.ts@@ -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)diff --git a/server/lib/video-privacy.ts b/server/lib/video-privacy.tsindex 39430ef1e7..5dd4d9781e 100644--- a/server/lib/video-privacy.ts+++ b/server/lib/video-privacy.ts@@ -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 }}diff --git a/server/lib/video-studio.ts b/server/lib/video-studio.tsindex 0d3db8f60d..f549a70843 100644--- a/server/lib/video-studio.ts+++ b/server/lib/video-studio.ts@@ -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)}}diff --git a/server/lib/video-urls.ts b/server/lib/video-urls.tsindex 64c2c9bf94..0597488ad4 100644--- a/server/lib/video-urls.ts+++ b/server/lib/video-urls.ts@@ -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}diff --git a/server/middlewares/validators/static.ts b/server/middlewares/validators/static.tsindex 36a94080c7..86cc0a8d70 100644--- a/server/middlewares/validators/static.ts+++ b/server/middlewares/validators/static.ts@@ -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)diff --git a/server/middlewares/validators/videos/video-files.ts b/server/middlewares/validators/videos/video-files.tsindex 92c5b9483b..6c0ecda428 100644--- a/server/middlewares/validators/videos/video-files.ts+++ b/server/middlewares/validators/videos/video-files.ts@@ -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,videoFilesDeleteHLSFileValidatordiff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.tsindex b829e4eb4e..b39d13a232 100644--- a/server/middlewares/validators/videos/videos.ts+++ b/server/middlewares/validators/videos/videos.ts@@ -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)diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.tsindex c2a72b71f4..cebf47dfd9 100644--- a/server/models/redundancy/video-redundancy.ts+++ b/server/models/redundancy/video-redundancy.ts@@ -162,7 +162,7 @@ export class VideoRedundancyModel extends Model<Partial<AttributesOnly<VideoReduconst 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 }))}diff --git a/server/models/user/user.ts b/server/models/user/user.tsindex 4f6a8fce44..ff6328d483 100644--- a/server/models/user/user.ts+++ b/server/models/user/user.ts@@ -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,diff --git a/server/models/video/sql/video/shared/abstract-video-query-builder.ts b/server/models/video/sql/video/shared/abstract-video-query-builder.tsindex cbd57ad8c9..56a00aa0c6 100644--- a/server/models/video/sql/video/shared/abstract-video-query-builder.ts+++ b/server/models/video/sql/video/shared/abstract-video-query-builder.ts@@ -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"'diff --git a/server/models/video/sql/video/shared/video-file-query-builder.ts b/server/models/video/sql/video/shared/video-file-query-builder.tsindex cc53a48606..196b72b43f 100644--- a/server/models/video/sql/video/shared/video-file-query-builder.ts+++ b/server/models/video/sql/video/shared/video-file-query-builder.ts@@ -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)diff --git a/server/models/video/sql/video/shared/video-model-builder.ts b/server/models/video/sql/video/shared/video-model-builder.tsindex 0a2beb7dbc..740aa842f0 100644--- a/server/models/video/sql/video/shared/video-model-builder.ts+++ b/server/models/video/sql/video/shared/video-model-builder.ts@@ -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 } = optionsthis.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) continueconst 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]) returndiff --git a/server/models/video/sql/video/video-model-get-query-builder.ts b/server/models/video/sql/video/video-model-get-query-builder.tsindex 8e90ff6411..3f43d4d921 100644--- a/server/models/video/sql/video/video-model-get-query-builder.ts+++ b/server/models/video/sql/video/video-model-get-query-builder.ts@@ -35,7 +35,7 @@ export type BuildVideoGetQueryOptions = {export class VideoModelGetQueryBuilder {videoQueryBuilder: VideosModelGetQuerySubBuilder- webtorrentFilesQueryBuilder: VideoFileQueryBuilder+ webVideoFilesQueryBuilder: VideoFileQueryBuilderstreamingPlaylistFilesQueryBuilder: VideoFileQueryBuilderprivate 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: stringprotected streamingPlaylistFilesQuery: stringprivate static readonly trackersInclude = new Set<GetType>([ 'api' ])diff --git a/server/models/video/sql/video/videos-id-list-query-builder.ts b/server/models/video/sql/video/videos-id-list-query-builder.tsindex cba77c1d1a..7f23761020 100644--- a/server/models/video/sql/video/videos-id-list-query-builder.ts+++ b/server/models/video/sql/video/videos-id-list-query-builder.ts@@ -48,7 +48,9 @@ export type BuildVideosListQueryOptions = {hasFiles?: booleanhasHLSFiles?: boolean- hasWebtorrentFiles?: boolean++ hasWebVideoFiles?: boolean+ hasWebtorrentFiles?: boolean // TODO: Remove in v7accountId?: numbervideoChannelId?: 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")'diff --git a/server/models/video/sql/video/videos-model-list-query-builder.ts b/server/models/video/sql/video/videos-model-list-query-builder.tsindex 3fdac4ed34..b73dc28cd5 100644--- a/server/models/video/sql/video/videos-model-list-query-builder.ts+++ b/server/models/video/sql/video/videos-model-list-query-builder.ts@@ -18,7 +18,7 @@ export class VideosModelListQueryBuilder extends AbstractVideoQueryBuilder {private innerQuery: stringprivate innerSort: string- webtorrentFilesQueryBuilder: VideoFileQueryBuilder+ webVideoFilesQueryBuilder: VideoFileQueryBuilderstreamingPlaylistFilesQueryBuilder: VideoFileQueryBuilderprivate 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 })}}diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.tsindex 2db4b523a6..26f072f4f6 100644--- a/server/models/video/video-change-ownership.ts+++ b/server/models/video/video-change-ownership.ts@@ -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]),diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.tsindex 07bc13de1a..5e476f3c70 100644--- a/server/models/video/video-file.ts+++ b/server/models/video/video-file.ts@@ -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: numberfps: numberresolution: 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)}diff --git a/server/models/video/video.ts b/server/models/video/video.tsindex 3a0d95b625..4c62972434 100644--- a/server/models/video/video.ts+++ b/server/models/video/video.ts@@ -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 torrentsinstance.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?: VideoIncludehasFiles?: boolean // default false- hasWebtorrentFiles?: boolean++ hasWebtorrentFiles?: boolean // TODO: remove in v7+ hasWebVideoFiles?: boolean+hasHLSFiles?: booleancategoryOneOf?: 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?: booleansearch?: 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 undefinedconst 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)diff --git a/server/tests/api/check-params/config.ts b/server/tests/api/check-params/config.tsindex 3c752cc3e0..7f825f79e8 100644--- a/server/tests/api/check-params/config.ts+++ b/server/tests/api/check-params/config.ts@@ -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,diff --git a/server/tests/api/check-params/transcoding.ts b/server/tests/api/check-params/transcoding.tsindex 9846ac1829..4bebcb5283 100644--- a/server/tests/api/check-params/transcoding.ts+++ b/server/tests/api/check-params/transcoding.ts@@ -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_400await 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_403await 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 () {diff --git a/server/tests/api/check-params/video-files.ts b/server/tests/api/check-params/video-files.tsindex 9dc59a1b50..4d43ab6f82 100644--- a/server/tests/api/check-params/video-files.ts+++ b/server/tests/api/check-params/video-files.ts@@ -60,7 +60,7 @@ describe('Test videos files', function () {})describe('Deleting files', function () {- let webtorrentId: string+ let webVideoId: stringlet hlsId: stringlet remoteId: string@@ -68,10 +68,10 @@ describe('Test videos files', function () {let validId2: stringlet hlsFileId: number- let webtorrentFileId: number+ let webVideoFileId: numberlet remoteHLSFileId: number- let remoteWebtorrentFileId: number+ let remoteWebVideoFileId: numberbefore(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.uuidremoteHLSFileId = 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.uuidhlsFileId = 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_404await 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_400await 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 })})})diff --git a/server/tests/api/object-storage/video-static-file-privacy.ts b/server/tests/api/object-storage/video-static-file-privacy.tsindex 2a7c3381dc..18d30a2f5e 100644--- a/server/tests/api/object-storage/video-static-file-privacy.ts+++ b/server/tests/api/object-storage/video-static-file-privacy.ts@@ -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})diff --git a/server/tests/api/object-storage/videos.ts b/server/tests/api/object-storage/videos.tsindex f837d9966f..c4f72bbe40 100644--- a/server/tests/api/object-storage/videos.ts+++ b/server/tests/api/object-storage/videos.ts@@ -41,8 +41,8 @@ async function checkFiles (options: {playlistBucket: stringplaylistPrefix?: 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} = optionslet allFiles = video.filesfor (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 + prefixexpectStartWith(file.fileUrl, start)@@ -134,8 +134,8 @@ function runTestSuite (options: {playlistBucket: stringplaylistPrefix?: string- webtorrentBucket: string- webtorrentPrefix?: string+ webVideoBucket: string+ webVideoPrefix?: stringuseMockBaseUrl?: boolean}) {@@ -161,7 +161,7 @@ function runTestSuite (options: {: undefinedawait 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})})diff --git a/server/tests/api/redundancy/redundancy.ts b/server/tests/api/redundancy/redundancy.tsindex 5262c503fb..b35059c293 100644--- a/server/tests/api/redundancy/redundancy.ts+++ b/server/tests/api/redundancy/redundancy.ts@@ -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, additionconst 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 = localWebVideoFilenamesif (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}}diff --git a/server/tests/api/transcoding/audio-only.ts b/server/tests/api/transcoding/audio-only.tsindex 1e31418e78..aa1113fc1f 100644--- a/server/tests/api/transcoding/audio-only.ts+++ b/server/tests/api/transcoding/audio-only.ts@@ -14,7 +14,7 @@ import {describe('Test audio only video transcoding', function () {let servers: PeerTubeServer[] = []let videoUUID: string- let webtorrentAudioFileUrl: string+ let webVideoAudioFileUrl: stringlet fragmentedAudioFileUrl: stringbefore(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].fileUrlfragmentedAudioFileUrl = 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)]diff --git a/server/tests/api/transcoding/create-transcoding.ts b/server/tests/api/transcoding/create-transcoding.tsindex d6f5b01dce..21a63f5471 100644--- a/server/tests/api/transcoding/create-transcoding.ts+++ b/server/tests/api/transcoding/create-transcoding.ts@@ -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) {diff --git a/server/tests/api/transcoding/hls.ts b/server/tests/api/transcoding/hls.tsindex c668d7e0bc..ba889e7187 100644--- a/server/tests/api/transcoding/hls.ts+++ b/server/tests/api/transcoding/hls.ts@@ -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)})diff --git a/server/tests/api/transcoding/transcoder.ts b/server/tests/api/transcoding/transcoder.tsindex 3cd247a248..36e1d90f4a 100644--- a/server/tests/api/transcoding/transcoder.ts+++ b/server/tests/api/transcoding/transcoder.ts@@ -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)}diff --git a/server/tests/api/transcoding/update-while-transcoding.ts b/server/tests/api/transcoding/update-while-transcoding.tsindex 61655f1021..2e0edc7703 100644--- a/server/tests/api/transcoding/update-while-transcoding.ts+++ b/server/tests/api/transcoding/update-while-transcoding.ts@@ -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)})diff --git a/server/tests/api/transcoding/video-studio.ts b/server/tests/api/transcoding/video-studio.tsindex e97f2b689e..2595d3cdba 100644--- a/server/tests/api/transcoding/video-studio.ts+++ b/server/tests/api/transcoding/video-studio.ts@@ -273,7 +273,7 @@ describe('Test video studio', function () {describe('HLS only studio edition', function () {before(async function () {- // Disable webtorrent+ // Disable Web Videosawait 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) {diff --git a/server/tests/api/users/user-videos.ts b/server/tests/api/users/user-videos.tsindex 6969495044..70f22e2ebc 100644--- a/server/tests/api/users/user-videos.ts+++ b/server/tests/api/users/user-videos.ts@@ -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){diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.tsindex 1c00f9a930..67ade1d0dc 100644--- a/server/tests/api/users/users.ts+++ b/server/tests/api/users/users.ts@@ -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 () {diff --git a/server/tests/api/videos/video-files.ts b/server/tests/api/videos/video-files.tsindex 8c913bf31a..0a183c44d8 100644--- a/server/tests/api/videos/video-files.ts+++ b/server/tests/api/videos/video-files.ts@@ -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: stringlet hlsId: stringbefore(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.filesfor (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 })})})diff --git a/server/tests/api/videos/videos-common-filters.ts b/server/tests/api/videos/videos-common-filters.tsindex 30251706b6..73c066bfb2 100644--- a/server/tests/api/videos/videos-common-filters.ts+++ b/server/tests/api/videos/videos-common-filters.ts@@ -154,7 +154,7 @@ describe('Test videos filter', function () {server: PeerTubeServerpath: stringisLocal?: boolean- hasWebtorrentFiles?: boolean+ hasWebVideoFiles?: booleanhasHLSFiles?: booleaninclude?: VideoIncludeprivacyOneOf?: 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.trueexpect(hasHLS(videos)).to.be.falseexpect(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.falseexpect(hasHLS(videos)).to.be.trueexpect(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.falseexpect(hasHLS(videos)).to.be.trueexpect(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.trueexpect(hasHLS(videos)).to.be.falseexpect(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.falseexpect(hasHLS(videos)).to.be.falseexpect(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.falseexpect(hasHLS(videos)).to.be.falseexpect(hasBoth(videos)).to.be.true}diff --git a/server/tests/peertube-runner/studio-transcoding.ts b/server/tests/peertube-runner/studio-transcoding.tsindex 9882019475..c265d7934f 100644--- a/server/tests/peertube-runner/studio-transcoding.ts+++ b/server/tests/peertube-runner/studio-transcoding.ts@@ -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) {diff --git a/server/tests/peertube-runner/vod-transcoding.ts b/server/tests/peertube-runner/vod-transcoding.tsindex c3f41c0978..eef6faf4e9 100644--- a/server/tests/peertube-runner/vod-transcoding.ts+++ b/server/tests/peertube-runner/vod-transcoding.ts@@ -24,13 +24,13 @@ describe('Test VOD transcoding in peertube-runner program', function () {let peertubeRunner: PeerTubeRunnerProcessfunction runSuite (options: {- webtorrentEnabled: boolean+ webVideoEnabled: booleanhlsEnabled: booleanobjectStorage?: 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 () {diff --git a/server/tests/plugins/plugin-helpers.ts b/server/tests/plugins/plugin-helpers.tsindex e951a1299c..f5a0cbe85f 100644--- a/server/tests/plugins/plugin-helpers.ts+++ b/server/tests/plugins/plugin-helpers.ts@@ -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 checkdiff --git a/server/tests/plugins/plugin-transcoding.ts b/server/tests/plugins/plugin-transcoding.tsindex 689eec5acd..f3d929426c 100644--- a/server/tests/plugins/plugin-transcoding.ts+++ b/server/tests/plugins/plugin-transcoding.ts@@ -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')diff --git a/server/tests/shared/videos.ts b/server/tests/shared/videos.tsindex 0bd1618201..6cba5b14c4 100644--- a/server/tests/shared/videos.ts+++ b/server/tests/shared/videos.ts@@ -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}diff --git a/server/tools/peertube-redundancy.ts b/server/tools/peertube-redundancy.tsindex fd6c760b23..c24eb5233b 100644--- a/server/tools/peertube-redundancy.ts+++ b/server/tools/peertube-redundancy.ts@@ -65,19 +65,19 @@ async function listRedundanciesCLI (target: VideoRedundanciesTarget) {}) as anyfor (const redundancy of data) {- const webtorrentFiles = redundancy.redundancies.files+ const webVideoFiles = redundancy.redundancies.filesconst streamingPlaylists = redundancy.redundancies.streamingPlaylistslet 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'),totalSizediff --git a/server/types/models/video/video-file.ts b/server/types/models/video/video-file.tsindex 55603e59c6..68106788d3 100644--- a/server/types/models/video/video-file.ts+++ b/server/types/models/video/video-file.ts@@ -38,6 +38,6 @@ export function isStreamingPlaylistFile (file: any): file is MVideoFileStreamingreturn !!file.videoStreamingPlaylistId}-export function isWebtorrentFile (file: any): file is MVideoFileVideo {+export function isWebVideoFile (file: any): file is MVideoFileVideo {return !!file.videoId}diff --git a/server/types/plugins/register-server-option.model.ts b/server/types/plugins/register-server-option.model.tsindex df419fff47..103ef234b0 100644--- a/server/types/plugins/register-server-option.model.ts+++ b/server/types/plugins/register-server-option.model.ts@@ -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 storageurl: stringdiff --git a/shared/models/search/videos-common-query.model.ts b/shared/models/search/videos-common-query.model.tsindex da479c928b..2c52ca8cf4 100644--- a/shared/models/search/videos-common-query.model.ts+++ b/shared/models/search/videos-common-query.model.ts@@ -30,7 +30,9 @@ export interface VideosCommonQuery {tagsAllOf?: string[]hasHLSFiles?: boolean- hasWebtorrentFiles?: boolean++ hasWebtorrentFiles?: boolean // TODO: remove in v7+ hasWebVideoFiles?: booleanskipCount?: booleandiff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.tsindex 9c40079fbf..c14806dabb 100644--- a/shared/models/server/job.model.ts+++ b/shared/models/server/job.model.ts@@ -148,17 +148,17 @@ export interface HLSTranscodingPayload extends BaseTranscodingPayload {fps: numbercopyCodecs: 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: VideoResolutionfps: number}export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {- type: 'merge-audio-to-webtorrent'+ type: 'merge-audio-to-web-video'resolution: VideoResolutionfps: 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| MergeAudioTranscodingPayloaddiff --git a/shared/models/users/user-update-me.model.ts b/shared/models/users/user-update-me.model.tsindex f3cceb5f26..c1d5ffba4e 100644--- a/shared/models/users/user-update-me.model.ts+++ b/shared/models/users/user-update-me.model.ts@@ -5,8 +5,6 @@ export interface UserUpdateMe {description?: stringnsfwPolicy?: NSFWPolicyType- // FIXME: deprecated in favour of p2pEnabled in 4.1- webTorrentEnabled?: booleanp2pEnabled?: booleanautoPlayVideo?: booleandiff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.tsindex 0761c1e327..9de4118b42 100644--- a/shared/models/users/user.model.ts+++ b/shared/models/users/user.model.ts@@ -22,8 +22,6 @@ export interface User {autoPlayNextVideo: booleanautoPlayNextVideoPlaylist: boolean- // @deprecated in favour of p2pEnabled- webTorrentEnabled: booleanp2pEnabled: booleanvideosHistoryEnabled: booleandiff --git a/shared/models/videos/transcoding/video-transcoding-create.model.ts b/shared/models/videos/transcoding/video-transcoding-create.model.tsindex aeb393e57d..c6e756a0a6 100644--- a/shared/models/videos/transcoding/video-transcoding-create.model.ts+++ b/shared/models/videos/transcoding/video-transcoding-create.model.ts@@ -1,3 +1,3 @@export interface VideoTranscodingCreate {- transcodingType: 'hls' | 'webtorrent'+ transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7}diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.tsindex 114db80916..00dc8e11cd 100644--- a/shared/server-commands/server/config-command.ts+++ b/shared/server-commands/server/config-command.ts@@ -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: hlsdiff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.tsindex 19645cb93a..4e66a900c0 100644--- a/shared/server-commands/server/servers-command.ts+++ b/shared/server-commands/server/servers-command.ts@@ -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)))}diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.tsindex 93ca623e1a..9602fa7dac 100644--- a/shared/server-commands/videos/videos-command.ts+++ b/shared/server-commands/videos/videos-command.ts@@ -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 | stringfileId: number}) {- const path = '/api/v1/videos/' + options.videoId + '/webtorrent/' + options.fileId+ const path = '/api/v1/videos/' + options.videoId + '/web-videos/' + options.fileIdreturn 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'diff --git a/support/doc/api/embeds.md b/support/doc/api/embeds.mdindex 493268c6ec..fd5507e387 100644--- a/support/doc/api/embeds.md+++ b/support/doc/api/embeds.md@@ -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`).### apidiff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yamlindex edf9990e37..e1a21fb5c8 100644--- a/support/doc/api/openapi.yaml+++ b/support/doc/api/openapi.yaml@@ -370,7 +370,7 @@ paths:get:tags:- Static Video Files- summary: Get public WebTorrent video file+ summary: Get public Web Video fileparameters:- $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 fileparameters:- $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 enableddelete:summary: Delete instance runtime configurationoperationId: 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: objectproperties: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 filessecurity:- OAuth2:- admintags:- Video Files- operationId: delVideoWebTorrent+ operationId: delVideoWebVideosparameters:- $ref: '#/components/parameters/idOrUUID'responses:@@ -4842,7 +4842,7 @@ paths:type: stringenum:- hls- - webtorrent+ - web-videorequired:- transcodingTyperesponses:@@ -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: booleandescription: '**PeerTube >= 4.0** Display only videos that have HLS files'- hasWebtorrentFiles:- name: hasWebtorrentFiles+ hasWebVideoFiles:+ name: hasWebVideoFilesin: queryrequired: falseschema: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: privacyOneOfin: 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: booleanwebtorrent:type: object- description: WebTorrent-specific settings+ description: Web Video specific settingsproperties:enabled:type: booleanhls:type: object- description: HLS-specific settings+ description: HLS specific settingsproperties:enabled:type: boolean@@ -9521,7 +9521,7 @@ components:type: stringenum:- 'p2p-media-loader'- - 'webtorrent'+ - 'web-video'resolution:type: numberdescription: Current player video resolution@@ -9753,7 +9753,7 @@ components:password:type: stringminLength: 2- videoId:+ videoId:$ref: '#/components/schemas/id'VideoPasswordList:properties:diff --git a/support/doc/tools.md b/support/doc/tools.mdindex 0c08cd2006..d30ff56b31 100644--- a/support/doc/tools.md+++ b/support/doc/tools.md@@ -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