From 1fe1c6c92546c5c5d95a42f74d46a800bf1685f4 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 16 Dec 2020 23:01:09 -0800 Subject: [PATCH] Move duplicate string to a constant --- core/rtmp/utils.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/rtmp/utils.go b/core/rtmp/utils.go index 7365503af..8897a74ba 100644 --- a/core/rtmp/utils.go +++ b/core/rtmp/utils.go @@ -11,6 +11,8 @@ import ( "github.com/owncast/owncast/models" ) +const unknownString = "Unknown" + func getInboundDetailsFromMetadata(metadata []interface{}) (models.RTMPStreamMetadata, error) { metadataComponentsString := fmt.Sprintf("%+v", metadata) if !strings.Contains(metadataComponentsString, "onMetaData") { @@ -50,12 +52,12 @@ func getAudioCodec(codec interface{}) string { return "Speex" } - return "Unknown" + return unknownString } func getVideoCodec(codec interface{}) string { if codec == nil { - return "Unknown" + return unknownString } var codecID float64 @@ -72,5 +74,5 @@ func getVideoCodec(codec interface{}) string { return "H.265" } - return "Unknown" + return unknownString }