X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-transcoding.ts;h=dcda82e0a169ad549813062cd68eada603662181;hb=923ff87da2761fd88a8ca269ac1ef403abb583d2;hp=bde4c2633ff1de483593afbe905d3e4ed953743f;hpb=7b81edc854902a536083298472bf92bb6726edcf;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-transcoding.ts b/server/lib/video-transcoding.ts index bde4c2633..dcda82e0a 100644 --- a/server/lib/video-transcoding.ts +++ b/server/lib/video-transcoding.ts @@ -2,8 +2,8 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION, WEBSER import { basename, extname as extnameUtil, join } from 'path' import { canDoQuickTranscode, - getMetadataFromFile, getDurationFromVideoFile, + getMetadataFromFile, getVideoFileFPS, transcode, TranscodeOptions, @@ -20,7 +20,6 @@ import { CONFIG } from '../initializers/config' import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/typings/models' import { createTorrentAndSetInfoHash } from '@server/helpers/webtorrent' import { generateVideoStreamingPlaylistName, getVideoFilename, getVideoFilePath } from './video-paths' -import { extractVideo } from './videos' /** * Optimize the original video file and replace it. The resolution is not changed. @@ -208,7 +207,7 @@ async function generateHlsPlaylist (video: MVideoWithFile, resolution: VideoReso await createTorrentAndSetInfoHash(videoStreamingPlaylist, newVideoFile) - await newVideoFile.save() + await VideoFileModel.customUpsert(newVideoFile, 'streaming-playlist', undefined) videoStreamingPlaylist.VideoFiles = await videoStreamingPlaylist.$get('VideoFiles') video.setHLSPlaylist(videoStreamingPlaylist)