aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-15 11:37:30 +0200
committerChocobozzz <me@florianbigard.com>2021-10-15 11:45:03 +0200
commit1e2fe802d1f82b81ac30fd9ca267da12f75032a2 (patch)
treec1d7142f825e277b56b5cd73f9de601ddcb20077 /server
parent3eb7ee658db32d270553046eeb77afc679a71466 (diff)
downloadPeerTube-1e2fe802d1f82b81ac30fd9ca267da12f75032a2.tar.gz
PeerTube-1e2fe802d1f82b81ac30fd9ca267da12f75032a2.tar.zst
PeerTube-1e2fe802d1f82b81ac30fd9ca267da12f75032a2.zip
Force live type specification in first step
Diffstat (limited to 'server')
-rw-r--r--server/lib/activitypub/videos/shared/abstract-builder.ts2
-rw-r--r--server/lib/activitypub/videos/shared/object-to-model-attributes.ts6
2 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/activitypub/videos/shared/abstract-builder.ts b/server/lib/activitypub/videos/shared/abstract-builder.ts
index f995fe637..788223b48 100644
--- a/server/lib/activitypub/videos/shared/abstract-builder.ts
+++ b/server/lib/activitypub/videos/shared/abstract-builder.ts
@@ -119,7 +119,7 @@ export abstract class APVideoAbstractBuilder {
119 } 119 }
120 120
121 protected async setStreamingPlaylists (video: MVideoFullLight, t: Transaction) { 121 protected async setStreamingPlaylists (video: MVideoFullLight, t: Transaction) {
122 const streamingPlaylistAttributes = getStreamingPlaylistAttributesFromObject(video, this.videoObject, video.VideoFiles || []) 122 const streamingPlaylistAttributes = getStreamingPlaylistAttributesFromObject(video, this.videoObject)
123 const newStreamingPlaylists = streamingPlaylistAttributes.map(a => new VideoStreamingPlaylistModel(a)) 123 const newStreamingPlaylists = streamingPlaylistAttributes.map(a => new VideoStreamingPlaylistModel(a))
124 124
125 // Remove video playlists that do not exist anymore 125 // Remove video playlists that do not exist anymore
diff --git a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts
index 50ca4e673..1e1479869 100644
--- a/server/lib/activitypub/videos/shared/object-to-model-attributes.ts
+++ b/server/lib/activitypub/videos/shared/object-to-model-attributes.ts
@@ -11,7 +11,7 @@ import { VideoCaptionModel } from '@server/models/video/video-caption'
11import { VideoFileModel } from '@server/models/video/video-file' 11import { VideoFileModel } from '@server/models/video/video-file'
12import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist' 12import { VideoStreamingPlaylistModel } from '@server/models/video/video-streaming-playlist'
13import { FilteredModelAttributes } from '@server/types' 13import { FilteredModelAttributes } from '@server/types'
14import { isStreamingPlaylist, MChannelId, MStreamingPlaylistVideo, MVideo, MVideoFile, MVideoId } from '@server/types/models' 14import { isStreamingPlaylist, MChannelId, MStreamingPlaylistVideo, MVideo, MVideoId } from '@server/types/models'
15import { 15import {
16 ActivityHashTagObject, 16 ActivityHashTagObject,
17 ActivityMagnetUrlObject, 17 ActivityMagnetUrlObject,
@@ -110,7 +110,7 @@ function getFileAttributesFromUrl (
110 return attributes 110 return attributes
111} 111}
112 112
113function getStreamingPlaylistAttributesFromObject (video: MVideoId, videoObject: VideoObject, videoFiles: MVideoFile[]) { 113function getStreamingPlaylistAttributesFromObject (video: MVideoId, videoObject: VideoObject) {
114 const playlistUrls = videoObject.url.filter(u => isAPStreamingPlaylistUrlObject(u)) as ActivityPlaylistUrlObject[] 114 const playlistUrls = videoObject.url.filter(u => isAPStreamingPlaylistUrlObject(u)) as ActivityPlaylistUrlObject[]
115 if (playlistUrls.length === 0) return [] 115 if (playlistUrls.length === 0) return []
116 116
@@ -118,7 +118,7 @@ function getStreamingPlaylistAttributesFromObject (video: MVideoId, videoObject:
118 for (const playlistUrlObject of playlistUrls) { 118 for (const playlistUrlObject of playlistUrls) {
119 const segmentsSha256UrlObject = playlistUrlObject.tag.find(isAPPlaylistSegmentHashesUrlObject) 119 const segmentsSha256UrlObject = playlistUrlObject.tag.find(isAPPlaylistSegmentHashesUrlObject)
120 120
121 let files: unknown[] = playlistUrlObject.tag.filter(u => isAPVideoUrlObject(u)) as ActivityVideoUrlObject[] 121 const files: unknown[] = playlistUrlObject.tag.filter(u => isAPVideoUrlObject(u)) as ActivityVideoUrlObject[]
122 122
123 if (!segmentsSha256UrlObject) { 123 if (!segmentsSha256UrlObject) {
124 logger.warn('No segment sha256 URL found in AP playlist object.', { playlistUrl: playlistUrlObject }) 124 logger.warn('No segment sha256 URL found in AP playlist object.', { playlistUrl: playlistUrlObject })