mirror of
https://github.com/owncast/owncast.git
synced 2025-11-03 13:01:46 +08:00
Simplify HLS storage paths (#1393)
* Remove private vs public HLS paths and add a HLS controller. Closes #875 * Use http.ServeFile instead
This commit is contained in:
@ -94,27 +94,16 @@ func handleTranscoderMessage(message string) {
|
||||
|
||||
func createVariantDirectories() {
|
||||
// Create private hls data dirs
|
||||
utils.CleanupDirectory(config.PublicHLSStoragePath)
|
||||
utils.CleanupDirectory(config.PrivateHLSStoragePath)
|
||||
utils.CleanupDirectory(config.HLSStoragePath)
|
||||
|
||||
if len(data.GetStreamOutputVariants()) != 0 {
|
||||
for index := range data.GetStreamOutputVariants() {
|
||||
if err := os.MkdirAll(path.Join(config.PrivateHLSStoragePath, strconv.Itoa(index)), 0750); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
dir := path.Join(config.PublicHLSStoragePath, strconv.Itoa(index))
|
||||
log.Traceln("Creating", dir)
|
||||
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||
if err := os.MkdirAll(path.Join(config.HLSStoragePath, strconv.Itoa(index)), 0750); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dir := path.Join(config.PrivateHLSStoragePath, strconv.Itoa(0))
|
||||
log.Traceln("Creating", dir)
|
||||
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
dir = path.Join(config.PublicHLSStoragePath, strconv.Itoa(0))
|
||||
dir := path.Join(config.HLSStoragePath, strconv.Itoa(0))
|
||||
log.Traceln("Creating", dir)
|
||||
if err := os.MkdirAll(dir, 0750); err != nil {
|
||||
log.Fatalln(err)
|
||||
|
||||
Reference in New Issue
Block a user