aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/hls.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/hls.ts')
-rw-r--r--server/lib/hls.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/hls.ts b/server/lib/hls.ts
index 9ec931b4f..a0a5afc0f 100644
--- a/server/lib/hls.ts
+++ b/server/lib/hls.ts
@@ -1,8 +1,9 @@
1import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat, writeFile } from 'fs-extra' 1import { close, ensureDir, move, open, outputJSON, read, readFile, remove, stat, writeFile } from 'fs-extra'
2import { flatten, uniq } from 'lodash' 2import { flatten } from 'lodash'
3import PQueue from 'p-queue' 3import PQueue from 'p-queue'
4import { basename, dirname, join } from 'path' 4import { basename, dirname, join } from 'path'
5import { MStreamingPlaylist, MStreamingPlaylistFilesVideo, MVideo } from '@server/types/models' 5import { MStreamingPlaylist, MStreamingPlaylistFilesVideo, MVideo } from '@server/types/models'
6import { uniqify } from '@shared/core-utils'
6import { sha256 } from '@shared/extra-utils' 7import { sha256 } from '@shared/extra-utils'
7import { VideoStorage } from '@shared/models' 8import { VideoStorage } from '@shared/models'
8import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamDimensionsInfo } from '../helpers/ffmpeg' 9import { getAudioStreamCodec, getVideoStreamCodec, getVideoStreamDimensionsInfo } from '../helpers/ffmpeg'
@@ -182,7 +183,7 @@ function downloadPlaylistSegments (playlistUrl: string, destinationDir: string,
182 const subPlaylistUrls = await fetchUniqUrls(playlistUrl) 183 const subPlaylistUrls = await fetchUniqUrls(playlistUrl)
183 184
184 const subRequests = subPlaylistUrls.map(u => fetchUniqUrls(u)) 185 const subRequests = subPlaylistUrls.map(u => fetchUniqUrls(u))
185 const fileUrls = uniq(flatten(await Promise.all(subRequests))) 186 const fileUrls = uniqify(flatten(await Promise.all(subRequests)))
186 187
187 logger.debug('Will download %d HLS files.', fileUrls.length, { fileUrls }) 188 logger.debug('Will download %d HLS files.', fileUrls.length, { fileUrls })
188 189
@@ -227,7 +228,7 @@ function downloadPlaylistSegments (playlistUrl: string, destinationDir: string,
227 return `${dirname(playlistUrl)}/${url}` 228 return `${dirname(playlistUrl)}/${url}`
228 }) 229 })
229 230
230 return uniq(urls) 231 return uniqify(urls)
231 } 232 }
232} 233}
233 234