diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-11 09:21:13 +0200 |
commit | 784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428 (patch) | |
tree | 29c46cfd6344065eb805680ed080cb05592ee1d4 /shared | |
parent | c3030e944ad03c7fd7b5d668a2d88ff03e4cdf19 (diff) | |
download | PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.gz PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.tar.zst PeerTube-784e2ad5c34bcfef36a3f69e9e9acd7cbb3d6428.zip |
Prefer web videos in favour of webtorrent
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/search/videos-common-query.model.ts | 4 | ||||
-rw-r--r-- | shared/models/server/job.model.ts | 12 | ||||
-rw-r--r-- | shared/models/users/user-update-me.model.ts | 2 | ||||
-rw-r--r-- | shared/models/users/user.model.ts | 2 | ||||
-rw-r--r-- | shared/models/videos/transcoding/video-transcoding-create.model.ts | 2 | ||||
-rw-r--r-- | shared/server-commands/server/config-command.ts | 8 | ||||
-rw-r--r-- | shared/server-commands/server/servers-command.ts | 2 | ||||
-rw-r--r-- | shared/server-commands/videos/videos-command.ts | 10 |
8 files changed, 20 insertions, 22 deletions
diff --git a/shared/models/search/videos-common-query.model.ts b/shared/models/search/videos-common-query.model.ts index da479c928..2c52ca8cf 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 { | |||
30 | tagsAllOf?: string[] | 30 | tagsAllOf?: string[] |
31 | 31 | ||
32 | hasHLSFiles?: boolean | 32 | hasHLSFiles?: boolean |
33 | hasWebtorrentFiles?: boolean | 33 | |
34 | hasWebtorrentFiles?: boolean // TODO: remove in v7 | ||
35 | hasWebVideoFiles?: boolean | ||
34 | 36 | ||
35 | skipCount?: boolean | 37 | skipCount?: boolean |
36 | 38 | ||
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts index 9c40079fb..c14806dab 100644 --- a/shared/models/server/job.model.ts +++ b/shared/models/server/job.model.ts | |||
@@ -148,17 +148,17 @@ export interface HLSTranscodingPayload extends BaseTranscodingPayload { | |||
148 | fps: number | 148 | fps: number |
149 | copyCodecs: boolean | 149 | copyCodecs: boolean |
150 | 150 | ||
151 | deleteWebTorrentFiles: boolean | 151 | deleteWebVideoFiles: boolean |
152 | } | 152 | } |
153 | 153 | ||
154 | export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload { | 154 | export interface NewWebVideoResolutionTranscodingPayload extends BaseTranscodingPayload { |
155 | type: 'new-resolution-to-webtorrent' | 155 | type: 'new-resolution-to-web-video' |
156 | resolution: VideoResolution | 156 | resolution: VideoResolution |
157 | fps: number | 157 | fps: number |
158 | } | 158 | } |
159 | 159 | ||
160 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | 160 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { |
161 | type: 'merge-audio-to-webtorrent' | 161 | type: 'merge-audio-to-web-video' |
162 | 162 | ||
163 | resolution: VideoResolution | 163 | resolution: VideoResolution |
164 | fps: number | 164 | fps: number |
@@ -167,7 +167,7 @@ export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | |||
167 | } | 167 | } |
168 | 168 | ||
169 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | 169 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { |
170 | type: 'optimize-to-webtorrent' | 170 | type: 'optimize-to-web-video' |
171 | 171 | ||
172 | quickTranscode: boolean | 172 | quickTranscode: boolean |
173 | 173 | ||
@@ -176,7 +176,7 @@ export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | |||
176 | 176 | ||
177 | export type VideoTranscodingPayload = | 177 | export type VideoTranscodingPayload = |
178 | HLSTranscodingPayload | 178 | HLSTranscodingPayload |
179 | | NewWebTorrentResolutionTranscodingPayload | 179 | | NewWebVideoResolutionTranscodingPayload |
180 | | OptimizeTranscodingPayload | 180 | | OptimizeTranscodingPayload |
181 | | MergeAudioTranscodingPayload | 181 | | MergeAudioTranscodingPayload |
182 | 182 | ||
diff --git a/shared/models/users/user-update-me.model.ts b/shared/models/users/user-update-me.model.ts index f3cceb5f2..c1d5ffba4 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 { | |||
5 | description?: string | 5 | description?: string |
6 | nsfwPolicy?: NSFWPolicyType | 6 | nsfwPolicy?: NSFWPolicyType |
7 | 7 | ||
8 | // FIXME: deprecated in favour of p2pEnabled in 4.1 | ||
9 | webTorrentEnabled?: boolean | ||
10 | p2pEnabled?: boolean | 8 | p2pEnabled?: boolean |
11 | 9 | ||
12 | autoPlayVideo?: boolean | 10 | autoPlayVideo?: boolean |
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts index 0761c1e32..9de4118b4 100644 --- a/shared/models/users/user.model.ts +++ b/shared/models/users/user.model.ts | |||
@@ -22,8 +22,6 @@ export interface User { | |||
22 | autoPlayNextVideo: boolean | 22 | autoPlayNextVideo: boolean |
23 | autoPlayNextVideoPlaylist: boolean | 23 | autoPlayNextVideoPlaylist: boolean |
24 | 24 | ||
25 | // @deprecated in favour of p2pEnabled | ||
26 | webTorrentEnabled: boolean | ||
27 | p2pEnabled: boolean | 25 | p2pEnabled: boolean |
28 | 26 | ||
29 | videosHistoryEnabled: boolean | 27 | videosHistoryEnabled: boolean |
diff --git a/shared/models/videos/transcoding/video-transcoding-create.model.ts b/shared/models/videos/transcoding/video-transcoding-create.model.ts index aeb393e57..c6e756a0a 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 @@ | |||
1 | export interface VideoTranscodingCreate { | 1 | export interface VideoTranscodingCreate { |
2 | transcodingType: 'hls' | 'webtorrent' | 2 | transcodingType: 'hls' | 'webtorrent' | 'web-video' // TODO: remove webtorrent in v7 |
3 | } | 3 | } |
diff --git a/shared/server-commands/server/config-command.ts b/shared/server-commands/server/config-command.ts index 114db8091..00dc8e11c 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 { | |||
131 | } | 131 | } |
132 | 132 | ||
133 | // TODO: convert args to object | 133 | // TODO: convert args to object |
134 | enableTranscoding (webtorrent = true, hls = true, with0p = false) { | 134 | enableTranscoding (webVideo = true, hls = true, with0p = false) { |
135 | return this.updateExistingSubConfig({ | 135 | return this.updateExistingSubConfig({ |
136 | newConfig: { | 136 | newConfig: { |
137 | transcoding: { | 137 | transcoding: { |
@@ -143,7 +143,7 @@ export class ConfigCommand extends AbstractCommand { | |||
143 | resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), | 143 | resolutions: ConfigCommand.getCustomConfigResolutions(true, with0p), |
144 | 144 | ||
145 | webtorrent: { | 145 | webtorrent: { |
146 | enabled: webtorrent | 146 | enabled: webVideo |
147 | }, | 147 | }, |
148 | hls: { | 148 | hls: { |
149 | enabled: hls | 149 | enabled: hls |
@@ -154,7 +154,7 @@ export class ConfigCommand extends AbstractCommand { | |||
154 | } | 154 | } |
155 | 155 | ||
156 | // TODO: convert args to object | 156 | // TODO: convert args to object |
157 | enableMinimumTranscoding (webtorrent = true, hls = true) { | 157 | enableMinimumTranscoding (webVideo = true, hls = true) { |
158 | return this.updateExistingSubConfig({ | 158 | return this.updateExistingSubConfig({ |
159 | newConfig: { | 159 | newConfig: { |
160 | transcoding: { | 160 | transcoding: { |
@@ -170,7 +170,7 @@ export class ConfigCommand extends AbstractCommand { | |||
170 | }, | 170 | }, |
171 | 171 | ||
172 | webtorrent: { | 172 | webtorrent: { |
173 | enabled: webtorrent | 173 | enabled: webVideo |
174 | }, | 174 | }, |
175 | hls: { | 175 | hls: { |
176 | enabled: hls | 176 | enabled: hls |
diff --git a/shared/server-commands/server/servers-command.ts b/shared/server-commands/server/servers-command.ts index 19645cb93..4e66a900c 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 { | |||
77 | return join(root(), 'test' + this.server.internalServerNumber, directory) | 77 | return join(root(), 'test' + this.server.internalServerNumber, directory) |
78 | } | 78 | } |
79 | 79 | ||
80 | buildWebTorrentFilePath (fileUrl: string) { | 80 | buildWebVideoFilePath (fileUrl: string) { |
81 | return this.buildDirectory(join('videos', basename(fileUrl))) | 81 | return this.buildDirectory(join('videos', basename(fileUrl))) |
82 | } | 82 | } |
83 | 83 | ||
diff --git a/shared/server-commands/videos/videos-command.ts b/shared/server-commands/videos/videos-command.ts index 93ca623e1..9602fa7da 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 { | |||
686 | }) | 686 | }) |
687 | } | 687 | } |
688 | 688 | ||
689 | removeAllWebTorrentFiles (options: OverrideCommandOptions & { | 689 | removeAllWebVideoFiles (options: OverrideCommandOptions & { |
690 | videoId: number | string | 690 | videoId: number | string |
691 | }) { | 691 | }) { |
692 | const path = '/api/v1/videos/' + options.videoId + '/webtorrent' | 692 | const path = '/api/v1/videos/' + options.videoId + '/web-videos' |
693 | 693 | ||
694 | return this.deleteRequest({ | 694 | return this.deleteRequest({ |
695 | ...options, | 695 | ...options, |
@@ -700,11 +700,11 @@ export class VideosCommand extends AbstractCommand { | |||
700 | }) | 700 | }) |
701 | } | 701 | } |
702 | 702 | ||
703 | removeWebTorrentFile (options: OverrideCommandOptions & { | 703 | removeWebVideoFile (options: OverrideCommandOptions & { |
704 | videoId: number | string | 704 | videoId: number | string |
705 | fileId: number | 705 | fileId: number |
706 | }) { | 706 | }) { |
707 | const path = '/api/v1/videos/' + options.videoId + '/webtorrent/' + options.fileId | 707 | const path = '/api/v1/videos/' + options.videoId + '/web-videos/' + options.fileId |
708 | 708 | ||
709 | return this.deleteRequest({ | 709 | return this.deleteRequest({ |
710 | ...options, | 710 | ...options, |
@@ -717,7 +717,7 @@ export class VideosCommand extends AbstractCommand { | |||
717 | 717 | ||
718 | runTranscoding (options: OverrideCommandOptions & { | 718 | runTranscoding (options: OverrideCommandOptions & { |
719 | videoId: number | string | 719 | videoId: number | string |
720 | transcodingType: 'hls' | 'webtorrent' | 720 | transcodingType: 'hls' | 'webtorrent' | 'web-video' |
721 | }) { | 721 | }) { |
722 | const path = '/api/v1/videos/' + options.videoId + '/transcoding' | 722 | const path = '/api/v1/videos/' + options.videoId + '/transcoding' |
723 | 723 | ||