]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/video-transcoding.ts
Add ability to override client assets : logo - favicon - PWA icons - PWA manifest...
[github/Chocobozzz/PeerTube.git] / server / lib / video-transcoding.ts
index bde4c2633ff1de483593afbe905d3e4ed953743f..628f22f5ea9b8052c414e335900b87cdcf119e7d 100644 (file)
@@ -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,
@@ -17,10 +17,9 @@ import { updateMasterHLSPlaylist, updateSha256Segments } from './hls'
 import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
 import { VideoStreamingPlaylistType } from '../../shared/models/videos/video-streaming-playlist.type'
 import { CONFIG } from '../initializers/config'
-import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/typings/models'
+import { MStreamingPlaylistFilesVideo, MVideoFile, MVideoWithAllFiles, MVideoWithFile } from '@server/types/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)