diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-05 12:00:31 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | 9c6ca37fc1512a99d420ea90707cebcd06cdc970 (patch) | |
tree | 2ef8e4c9bc30e911923a5b5c83f18e983553929d /server/lib | |
parent | 09979f8959425390b879bce22101a9bc061ae9a0 (diff) | |
download | PeerTube-9c6ca37fc1512a99d420ea90707cebcd06cdc970.tar.gz PeerTube-9c6ca37fc1512a99d420ea90707cebcd06cdc970.tar.zst PeerTube-9c6ca37fc1512a99d420ea90707cebcd06cdc970.zip |
Rename streaming playlists routes/directories
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/url.ts | 2 | ||||
-rw-r--r-- | server/lib/hls.ts | 6 | ||||
-rw-r--r-- | server/lib/video-transcoding.ts | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index c80b09436..7c2ee5bc6 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts | |||
@@ -27,7 +27,7 @@ function getVideoCacheFileActivityPubUrl (videoFile: VideoFileModel) { | |||
27 | } | 27 | } |
28 | 28 | ||
29 | function getVideoCacheStreamingPlaylistActivityPubUrl (video: VideoModel, playlist: VideoStreamingPlaylistModel) { | 29 | function getVideoCacheStreamingPlaylistActivityPubUrl (video: VideoModel, playlist: VideoStreamingPlaylistModel) { |
30 | return `${CONFIG.WEBSERVER.URL}/redundancy/video-playlists/${playlist.getStringType()}/${video.uuid}` | 30 | return `${CONFIG.WEBSERVER.URL}/redundancy/streaming-playlists/${playlist.getStringType()}/${video.uuid}` |
31 | } | 31 | } |
32 | 32 | ||
33 | function getVideoCommentActivityPubUrl (video: VideoModel, videoComment: VideoCommentModel) { | 33 | function getVideoCommentActivityPubUrl (video: VideoModel, videoComment: VideoCommentModel) { |
diff --git a/server/lib/hls.ts b/server/lib/hls.ts index 16a805ac2..74ed25183 100644 --- a/server/lib/hls.ts +++ b/server/lib/hls.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { VideoModel } from '../models/video/video' | 1 | import { VideoModel } from '../models/video/video' |
2 | import { basename, join, dirname } from 'path' | 2 | import { basename, join, dirname } from 'path' |
3 | import { CONFIG, HLS_PLAYLIST_DIRECTORY } from '../initializers' | 3 | import { CONFIG, HLS_STREAMING_PLAYLIST_DIRECTORY } from '../initializers' |
4 | import { close, ensureDir, move, open, outputJSON, pathExists, read, readFile, remove, writeFile } from 'fs-extra' | 4 | import { close, ensureDir, move, open, outputJSON, pathExists, read, readFile, remove, writeFile } from 'fs-extra' |
5 | import { getVideoFileSize } from '../helpers/ffmpeg-utils' | 5 | import { getVideoFileSize } from '../helpers/ffmpeg-utils' |
6 | import { sha256 } from '../helpers/core-utils' | 6 | import { sha256 } from '../helpers/core-utils' |
@@ -11,7 +11,7 @@ import { generateRandomString } from '../helpers/utils' | |||
11 | import { flatten, uniq } from 'lodash' | 11 | import { flatten, uniq } from 'lodash' |
12 | 12 | ||
13 | async function updateMasterHLSPlaylist (video: VideoModel) { | 13 | async function updateMasterHLSPlaylist (video: VideoModel) { |
14 | const directory = join(HLS_PLAYLIST_DIRECTORY, video.uuid) | 14 | const directory = join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid) |
15 | const masterPlaylists: string[] = [ '#EXTM3U', '#EXT-X-VERSION:3' ] | 15 | const masterPlaylists: string[] = [ '#EXTM3U', '#EXT-X-VERSION:3' ] |
16 | const masterPlaylistPath = join(directory, VideoStreamingPlaylistModel.getMasterHlsPlaylistFilename()) | 16 | const masterPlaylistPath = join(directory, VideoStreamingPlaylistModel.getMasterHlsPlaylistFilename()) |
17 | 17 | ||
@@ -40,7 +40,7 @@ async function updateMasterHLSPlaylist (video: VideoModel) { | |||
40 | async function updateSha256Segments (video: VideoModel) { | 40 | async function updateSha256Segments (video: VideoModel) { |
41 | const json: { [filename: string]: { [range: string]: string } } = {} | 41 | const json: { [filename: string]: { [range: string]: string } } = {} |
42 | 42 | ||
43 | const playlistDirectory = join(HLS_PLAYLIST_DIRECTORY, video.uuid) | 43 | const playlistDirectory = join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid) |
44 | 44 | ||
45 | // For all the resolutions available for this video | 45 | // For all the resolutions available for this video |
46 | for (const file of video.VideoFiles) { | 46 | for (const file of video.VideoFiles) { |
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index 086b860a2..e932c0e55 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { CONFIG, HLS_PLAYLIST_DIRECTORY } from '../initializers' | 1 | import { CONFIG, HLS_STREAMING_PLAYLIST_DIRECTORY } from '../initializers' |
2 | import { extname, join } from 'path' | 2 | import { extname, join } from 'path' |
3 | import { getVideoFileFPS, getVideoFileResolution, transcode } from '../helpers/ffmpeg-utils' | 3 | import { getVideoFileFPS, getVideoFileResolution, transcode } from '../helpers/ffmpeg-utils' |
4 | import { copy, ensureDir, move, remove, stat } from 'fs-extra' | 4 | import { copy, ensureDir, move, remove, stat } from 'fs-extra' |
@@ -89,8 +89,8 @@ async function transcodeOriginalVideofile (video: VideoModel, resolution: VideoR | |||
89 | } | 89 | } |
90 | 90 | ||
91 | async function generateHlsPlaylist (video: VideoModel, resolution: VideoResolution, isPortraitMode: boolean) { | 91 | async function generateHlsPlaylist (video: VideoModel, resolution: VideoResolution, isPortraitMode: boolean) { |
92 | const baseHlsDirectory = join(HLS_PLAYLIST_DIRECTORY, video.uuid) | 92 | const baseHlsDirectory = join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid) |
93 | await ensureDir(join(HLS_PLAYLIST_DIRECTORY, video.uuid)) | 93 | await ensureDir(join(HLS_STREAMING_PLAYLIST_DIRECTORY, video.uuid)) |
94 | 94 | ||
95 | const videoInputPath = join(CONFIG.STORAGE.VIDEOS_DIR, video.getVideoFilename(video.getOriginalFile())) | 95 | const videoInputPath = join(CONFIG.STORAGE.VIDEOS_DIR, video.getVideoFilename(video.getOriginalFile())) |
96 | const outputPath = join(baseHlsDirectory, VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution)) | 96 | const outputPath = join(baseHlsDirectory, VideoStreamingPlaylistModel.getHlsPlaylistFilename(resolution)) |