diff --git a/config/config.go b/config/config.go index d5e707b93..73a995455 100644 --- a/config/config.go +++ b/config/config.go @@ -43,8 +43,8 @@ var EnableAutoUpdate = false // A temporary stream key that can be set via the command line. var TemporaryStreamKey = "" -// EnableRecordingFeatures will enable recording features. -var EnableRecordingFeatures = true +// EnableReplayFeatures will enable replay features. +var EnableReplayFeatures = true // GetCommit will return an identifier used for identifying the point in time this build took place. func GetCommit() string { diff --git a/core/core.go b/core/core.go index ef356feac..a048af0d4 100644 --- a/core/core.go +++ b/core/core.go @@ -130,7 +130,7 @@ func resetDirectories() { log.Trace("Resetting file directories to a clean slate.") // Wipe hls data directory - utils.CleanupDirectory(config.HLSStoragePath, config.EnableRecordingFeatures) + utils.CleanupDirectory(config.HLSStoragePath, config.EnableReplayFeatures) // Remove the previous thumbnail logo := data.GetLogoPath() diff --git a/core/storageproviders/local.go b/core/storageproviders/local.go index 0cb437208..da6db6c2c 100644 --- a/core/storageproviders/local.go +++ b/core/storageproviders/local.go @@ -86,7 +86,7 @@ func (s *LocalStorage) Save(filePath, destinationPath string, retryCount int) (s func (s *LocalStorage) Cleanup() error { // If we're recording, don't perform the cleanup. - if config.EnableRecordingFeatures { + if config.EnableReplayFeatures { return nil } diff --git a/core/storageproviders/s3Storage.go b/core/storageproviders/s3Storage.go index 682ac1708..2c1dd1032 100644 --- a/core/storageproviders/s3Storage.go +++ b/core/storageproviders/s3Storage.go @@ -205,7 +205,7 @@ func (s *S3Storage) Save(localFilePath, remoteDestinationPath string, retryCount func (s *S3Storage) Cleanup() error { // If we're recording, don't perform the cleanup. - if config.EnableRecordingFeatures { + if config.EnableReplayFeatures { return nil } diff --git a/core/streamState.go b/core/streamState.go index f2ba9493a..ee3565f5b 100644 --- a/core/streamState.go +++ b/core/streamState.go @@ -52,7 +52,7 @@ func setStreamAsConnected(rtmpOut *io.PipeReader) { StopOfflineCleanupTimer() - if !config.EnableRecordingFeatures { + if !config.EnableReplayFeatures { startOnlineCleanupTimer() } diff --git a/core/transcoder/hlsHandler.go b/core/transcoder/hlsHandler.go index 3b931700c..d70de0456 100644 --- a/core/transcoder/hlsHandler.go +++ b/core/transcoder/hlsHandler.go @@ -16,7 +16,7 @@ type HLSHandler struct { // StreamEnded is called when a stream is ended so the end time can be noted // in the stream's metadata. func (h *HLSHandler) StreamEnded() { - if config.EnableRecordingFeatures { + if config.EnableReplayFeatures { h.Recorder.StreamEnded() } } diff --git a/core/transcoder/utils.go b/core/transcoder/utils.go index a9e4ff631..cccb558d0 100644 --- a/core/transcoder/utils.go +++ b/core/transcoder/utils.go @@ -98,7 +98,7 @@ func handleTranscoderMessage(message string) { func createVariantDirectories(streamID string) { // Create private hls data dirs - utils.CleanupDirectory(config.HLSStoragePath, config.EnableRecordingFeatures) + utils.CleanupDirectory(config.HLSStoragePath, config.EnableReplayFeatures) if len(data.GetStreamOutputVariants()) != 0 { for index := range data.GetStreamOutputVariants() { diff --git a/replays/playlistGenerator.go b/replays/playlistGenerator.go index d0774a508..4a3c653f6 100644 --- a/replays/playlistGenerator.go +++ b/replays/playlistGenerator.go @@ -30,11 +30,6 @@ func NewPlaylistGenerator() *PlaylistGenerator { } func (p *PlaylistGenerator) GenerateMasterPlaylistForStream(streamId string) (*m3u8.MasterPlaylist, error) { - // stream, err := p.GetStream(streamId) - // if err != nil { - // return nil, errors.Wrap(err, "failed to get stream") - // } - // Determine the different output configurations for this stream. configs, err := p.GetConfigurationsForStream(streamId) if err != nil { @@ -261,23 +256,3 @@ func createConfigFromConfigRow(row db.GetOutputConfigurationForIdRow) *HLSOutput } return &config } - -// func createOutputConfigsFromConfigRows(rows []db.GetOutputConfigurationsForStreamIdRow) []HLSOutputConfiguration { -// outputConfigs := []HLSOutputConfiguration{} -// for _, row := range rows { -// config := HLSOutputConfiguration{ -// ID: row.ID, -// StreamId: row.StreamID, -// VariantId: row.VariantID, -// Name: row.Name, -// VideoBitrate: int(row.Bitrate), -// Framerate: int(row.Framerate), -// ScaledHeight: int(row.ResolutionWidth.Int32), -// ScaledWidth: int(row.ResolutionHeight.Int32), -// SegmentDuration: float64(row.SegmentDuration), -// } -// outputConfigs = append(outputConfigs, config) -// } - -// return outputConfigs -// }