aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-18 11:28:00 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-18 13:38:09 +0100
commit8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769 (patch)
tree863daf231cf4a66d9e5abf1cfe4fbe2b742cd856 /server/lib
parentf66db4d5c851fe87bb71cccee96926000f59a15b (diff)
downloadPeerTube-8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769.tar.gz
PeerTube-8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769.tar.zst
PeerTube-8efc27bf14f1fe3ed23cd8a6d2de1f0918a7f769.zip
Cleanup
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/activitypub/videos.ts2
-rw-r--r--server/lib/job-queue/handlers/video-file-import.ts2
-rw-r--r--server/lib/job-queue/handlers/video-import.ts2
-rw-r--r--server/lib/video-transcoding.ts4
4 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index 66330a964..c38edad56 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -912,7 +912,7 @@ function getTrackerUrls (object: VideoObject, video: MVideoWithHost) {
912 912
913 const trackers = object.url.filter(u => isAPVideoTrackerUrlObject(u)) 913 const trackers = object.url.filter(u => isAPVideoTrackerUrlObject(u))
914 .map((u: ActivityTrackerUrlObject) => { 914 .map((u: ActivityTrackerUrlObject) => {
915 if (u.rel.includes('websocket')) wsFound = true 915 if (isArray(u.rel) && u.rel.includes('websocket')) wsFound = true
916 916
917 return u.href 917 return u.href
918 }) 918 })
diff --git a/server/lib/job-queue/handlers/video-file-import.ts b/server/lib/job-queue/handlers/video-file-import.ts
index 839916306..71f2cafcd 100644
--- a/server/lib/job-queue/handlers/video-file-import.ts
+++ b/server/lib/job-queue/handlers/video-file-import.ts
@@ -82,7 +82,7 @@ async function updateVideoFile (video: MVideoFullLight, inputFilePath: string) {
82 await copy(inputFilePath, outputPath) 82 await copy(inputFilePath, outputPath)
83 83
84 video.VideoFiles.push(newVideoFile) 84 video.VideoFiles.push(newVideoFile)
85 await createTorrentAndSetInfoHash(video, video, newVideoFile) 85 await createTorrentAndSetInfoHash(video, newVideoFile)
86 86
87 await newVideoFile.save() 87 await newVideoFile.save()
88} 88}
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index 8fa024105..ed2c5eac0 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -185,7 +185,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: MVid
185 } 185 }
186 186
187 // Create torrent 187 // Create torrent
188 await createTorrentAndSetInfoHash(videoImportWithFiles.Video, videoImportWithFiles.Video, videoFile) 188 await createTorrentAndSetInfoHash(videoImportWithFiles.Video, videoFile)
189 189
190 const videoFileSave = videoFile.toJSON() 190 const videoFileSave = videoFile.toJSON()
191 191
diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts
index e3cd18e25..c949dca2e 100644
--- a/server/lib/video-transcoding.ts
+++ b/server/lib/video-transcoding.ts
@@ -254,7 +254,7 @@ async function onWebTorrentVideoFileTranscoding (
254 videoFile.fps = fps 254 videoFile.fps = fps
255 videoFile.metadata = metadata 255 videoFile.metadata = metadata
256 256
257 await createTorrentAndSetInfoHash(video, video, videoFile) 257 await createTorrentAndSetInfoHash(video, videoFile)
258 258
259 await VideoFileModel.customUpsert(videoFile, 'video', undefined) 259 await VideoFileModel.customUpsert(videoFile, 'video', undefined)
260 video.VideoFiles = await video.$get('VideoFiles') 260 video.VideoFiles = await video.$get('VideoFiles')
@@ -350,7 +350,7 @@ async function generateHlsPlaylistCommon (options: {
350 newVideoFile.fps = await getVideoFileFPS(videoFilePath) 350 newVideoFile.fps = await getVideoFileFPS(videoFilePath)
351 newVideoFile.metadata = await getMetadataFromFile(videoFilePath) 351 newVideoFile.metadata = await getMetadataFromFile(videoFilePath)
352 352
353 await createTorrentAndSetInfoHash(videoStreamingPlaylist, video, newVideoFile) 353 await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile)
354 354
355 await VideoFileModel.customUpsert(newVideoFile, 'streaming-playlist', undefined) 355 await VideoFileModel.customUpsert(newVideoFile, 'streaming-playlist', undefined)
356 videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles') 356 videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles')