mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Prefer web videos in favour of webtorrent
This commit is contained in:
parent
c3030e944a
commit
784e2ad5c3
102 changed files with 579 additions and 570 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue