From 669cd176b53a2300794168a021d91341dc2c02c3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 10 May 2023 11:23:51 +1000 Subject: [PATCH] Remove public version const Inspired by https://github.com/anacrolix/dms/pull/120#issuecomment-1541014775. --- dlna/dms/dms.go | 12 ++++++++---- version/version.go | 3 --- 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 version/version.go diff --git a/dlna/dms/dms.go b/dlna/dms/dms.go index 755903e..4420fa8 100755 --- a/dlna/dms/dms.go +++ b/dlna/dms/dms.go @@ -31,15 +31,19 @@ import ( "github.com/anacrolix/dms/transcode" "github.com/anacrolix/dms/upnp" "github.com/anacrolix/dms/upnpav" - "github.com/anacrolix/dms/version" "github.com/anacrolix/ffprobe" ) +// This is used when communicating with other devices, such as over HTTP. I don't imagine we're +// popular enough to have special treatment yet. This value would change if we made potentially +// breaking changes to our behaviour that other devices might want to act on. +const serverVersion = "1" + var ( serverField = fmt.Sprintf(`Linux/3.4 DLNADOC/1.50 UPnP/1.0 %s/%s`, userAgentProduct, - version.DmsVersion) - rootDeviceModelName = fmt.Sprintf("%s %s", userAgentProduct, version.DmsVersion) + serverVersion) + rootDeviceModelName = fmt.Sprintf("%s %s", userAgentProduct, serverVersion) ) const ( @@ -443,7 +447,7 @@ func (me *Server) serveDLNATranscode(w http.ResponseWriter, r *http.Request, pat } else { logTsName = tsname } - stderrPath:= strings.Replace(me.TranscodeLogPattern, "[tsname]", logTsName, -1) + stderrPath := strings.Replace(me.TranscodeLogPattern, "[tsname]", logTsName, -1) var logFile io.Writer if stderrPath != "" { os.MkdirAll(filepath.Dir(stderrPath), 0o750) diff --git a/version/version.go b/version/version.go deleted file mode 100644 index 04d7633..0000000 --- a/version/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package version - -const DmsVersion = "1.5"