fix: some small cleanup

This commit is contained in:
Gabe Kangas 2023-08-09 16:35:42 -07:00
parent 4ba36c17a3
commit e1b9c160c9
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
8 changed files with 8 additions and 33 deletions

View File

@ -43,8 +43,8 @@ var EnableAutoUpdate = false
// A temporary stream key that can be set via the command line. // A temporary stream key that can be set via the command line.
var TemporaryStreamKey = "" var TemporaryStreamKey = ""
// EnableRecordingFeatures will enable recording features. // EnableReplayFeatures will enable replay features.
var EnableRecordingFeatures = true var EnableReplayFeatures = true
// GetCommit will return an identifier used for identifying the point in time this build took place. // GetCommit will return an identifier used for identifying the point in time this build took place.
func GetCommit() string { func GetCommit() string {

View File

@ -130,7 +130,7 @@ func resetDirectories() {
log.Trace("Resetting file directories to a clean slate.") log.Trace("Resetting file directories to a clean slate.")
// Wipe hls data directory // Wipe hls data directory
utils.CleanupDirectory(config.HLSStoragePath, config.EnableRecordingFeatures) utils.CleanupDirectory(config.HLSStoragePath, config.EnableReplayFeatures)
// Remove the previous thumbnail // Remove the previous thumbnail
logo := data.GetLogoPath() logo := data.GetLogoPath()

View File

@ -86,7 +86,7 @@ func (s *LocalStorage) Save(filePath, destinationPath string, retryCount int) (s
func (s *LocalStorage) Cleanup() error { func (s *LocalStorage) Cleanup() error {
// If we're recording, don't perform the cleanup. // If we're recording, don't perform the cleanup.
if config.EnableRecordingFeatures { if config.EnableReplayFeatures {
return nil return nil
} }

View File

@ -205,7 +205,7 @@ func (s *S3Storage) Save(localFilePath, remoteDestinationPath string, retryCount
func (s *S3Storage) Cleanup() error { func (s *S3Storage) Cleanup() error {
// If we're recording, don't perform the cleanup. // If we're recording, don't perform the cleanup.
if config.EnableRecordingFeatures { if config.EnableReplayFeatures {
return nil return nil
} }

View File

@ -52,7 +52,7 @@ func setStreamAsConnected(rtmpOut *io.PipeReader) {
StopOfflineCleanupTimer() StopOfflineCleanupTimer()
if !config.EnableRecordingFeatures { if !config.EnableReplayFeatures {
startOnlineCleanupTimer() startOnlineCleanupTimer()
} }

View File

@ -16,7 +16,7 @@ type HLSHandler struct {
// StreamEnded is called when a stream is ended so the end time can be noted // StreamEnded is called when a stream is ended so the end time can be noted
// in the stream's metadata. // in the stream's metadata.
func (h *HLSHandler) StreamEnded() { func (h *HLSHandler) StreamEnded() {
if config.EnableRecordingFeatures { if config.EnableReplayFeatures {
h.Recorder.StreamEnded() h.Recorder.StreamEnded()
} }
} }

View File

@ -98,7 +98,7 @@ func handleTranscoderMessage(message string) {
func createVariantDirectories(streamID string) { func createVariantDirectories(streamID string) {
// Create private hls data dirs // Create private hls data dirs
utils.CleanupDirectory(config.HLSStoragePath, config.EnableRecordingFeatures) utils.CleanupDirectory(config.HLSStoragePath, config.EnableReplayFeatures)
if len(data.GetStreamOutputVariants()) != 0 { if len(data.GetStreamOutputVariants()) != 0 {
for index := range data.GetStreamOutputVariants() { for index := range data.GetStreamOutputVariants() {

View File

@ -30,11 +30,6 @@ func NewPlaylistGenerator() *PlaylistGenerator {
} }
func (p *PlaylistGenerator) GenerateMasterPlaylistForStream(streamId string) (*m3u8.MasterPlaylist, error) { 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. // Determine the different output configurations for this stream.
configs, err := p.GetConfigurationsForStream(streamId) configs, err := p.GetConfigurationsForStream(streamId)
if err != nil { if err != nil {
@ -261,23 +256,3 @@ func createConfigFromConfigRow(row db.GetOutputConfigurationForIdRow) *HLSOutput
} }
return &config 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
// }