Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[server] add documentation for GetDeviceType function

Priyanshu Dangare7ee8724e88ec
diff --git a/server/pkg/utils/ua/ua.go b/server/pkg/utils/ua/ua.go
index dd08cb1dde..b18530d030 100644
--- a/server/pkg/utils/ua/ua.go
+++ b/server/pkg/utils/ua/ua.go
@@ -8,6 +8,9 @@ import (
"golang.org/x/text/language"
)
+// Returns the type of device based on the user agent.
+// Example: Desktop, Mobile, Tablet, TV, etc.
+// Returns empty string if the user agent is invalid or the device type is not found, or err is not nil.
func GetDeviceType(ua string) (string, error) {
dd, dderr := devicedetector.NewDeviceDetector()
if dderr != nil {