]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/hls.ts
Add a test for refreshing remote keys
[github/Chocobozzz/PeerTube.git] / server / lib / hls.ts
index 9ea83f33762f5a5658b7c8ebc5b6748ac1b57568..04187668c7afd4f2b24b8a50da8dad624c112edd 100644 (file)
@@ -12,7 +12,7 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, P2P_MEDIA_LOADER_PEER_VERSION } from
 import { sequelizeTypescript } from '../initializers/database'
 import { VideoFileModel } from '../models/video/video-file'
 import { VideoStreamingPlaylistModel } from '../models/video/video-streaming-playlist'
-import { getVideoFilename, getVideoFilePath } from './video-paths'
+import { getVideoFilePath } from './video-paths'
 
 async function updateStreamingPlaylistsInfohashesIfNeeded () {
   const playlistsToUpdate = await VideoStreamingPlaylistModel.listByIncorrectPeerVersion()
@@ -93,7 +93,7 @@ async function updateSha256VODSegments (video: MVideoWithFile) {
     }
     await close(fd)
 
-    const videoFilename = getVideoFilename(hlsPlaylist, file)
+    const videoFilename = file.filename
     json[videoFilename] = rangeHashes
   }
 
@@ -111,7 +111,7 @@ function downloadPlaylistSegments (playlistUrl: string, destinationDir: string,
 
   logger.info('Importing HLS playlist %s', playlistUrl)
 
-  return new Promise<string>(async (res, rej) => {
+  return new Promise<void>(async (res, rej) => {
     const tmpDirectory = join(CONFIG.STORAGE.TMP_DIR, await generateRandomString(10))
 
     await ensureDir(tmpDirectory)