Browse Source

fix: some small cleanup

pull/3395/head
Gabe Kangas 2 years ago
parent
commit
e1b9c160c9
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 4
      config/config.go
  2. 2
      core/core.go
  3. 2
      core/storageproviders/local.go
  4. 2
      core/storageproviders/s3Storage.go
  5. 2
      core/streamState.go
  6. 2
      core/transcoder/hlsHandler.go
  7. 2
      core/transcoder/utils.go
  8. 25
      replays/playlistGenerator.go

4
config/config.go

@ -43,8 +43,8 @@ var EnableAutoUpdate = false @@ -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 {

2
core/core.go

@ -130,7 +130,7 @@ func resetDirectories() { @@ -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()

2
core/storageproviders/local.go

@ -86,7 +86,7 @@ func (s *LocalStorage) Save(filePath, destinationPath string, retryCount int) (s @@ -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
}

2
core/storageproviders/s3Storage.go

@ -205,7 +205,7 @@ func (s *S3Storage) Save(localFilePath, remoteDestinationPath string, retryCount @@ -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
}

2
core/streamState.go

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

2
core/transcoder/hlsHandler.go

@ -16,7 +16,7 @@ type HLSHandler struct { @@ -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()
}
}

2
core/transcoder/utils.go

@ -98,7 +98,7 @@ func handleTranscoderMessage(message string) { @@ -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() {

25
replays/playlistGenerator.go

@ -30,11 +30,6 @@ func NewPlaylistGenerator() *PlaylistGenerator { @@ -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 @@ -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
// }

Loading…
Cancel
Save