aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/lib/object-storage/keys.ts
blob: 4f17073f48afab4ef079ad0520b667bcd8ca2b88 (plain) (tree)
1
2
3
4
5
6
7
8
9
                           
                                                              
 

                                                                                            

 

                                                                              










                                                                
import { join } from 'path'
import { MStreamingPlaylistVideo } from '@server/types/models'

function generateHLSObjectStorageKey (playlist: MStreamingPlaylistVideo, filename: string) {
  return join(generateHLSObjectBaseStorageKey(playlist), filename)
}

function generateHLSObjectBaseStorageKey (playlist: MStreamingPlaylistVideo) {
  return join(playlist.getStringType(), playlist.Video.uuid)
}

function generateWebTorrentObjectStorageKey (filename: string) {
  return filename
}

export {
  generateHLSObjectStorageKey,
  generateHLSObjectBaseStorageKey,
  generateWebTorrentObjectStorageKey
}