mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
fix: some small cleanup
This commit is contained in:
parent
4ba36c17a3
commit
e1b9c160c9
@ -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 {
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ func setStreamAsConnected(rtmpOut *io.PipeReader) {
|
||||
|
||||
StopOfflineCleanupTimer()
|
||||
|
||||
if !config.EnableRecordingFeatures {
|
||||
if !config.EnableReplayFeatures {
|
||||
startOnlineCleanupTimer()
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
// }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user