From 7c34a3a632468388d3876cd0f4e9550bd3af64ca Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 10 May 2024 00:09:35 +0400 Subject: [PATCH] A func Site was added to return a schema://host string. --- pkg/utils/dwelling.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/utils/dwelling.go b/pkg/utils/dwelling.go index f524790..6ec125c 100644 --- a/pkg/utils/dwelling.go +++ b/pkg/utils/dwelling.go @@ -19,6 +19,13 @@ func MainSite(host string) string { return "https://arav.su" } +func Site(host string) string { + if strings.Contains(host, ".su") { + return "https://radio.arav.su" + } + return "http://" + host +} + // ToClientTimezone converts given time to timezone set in a // X-Client-Timezone header. If this header is not set, then // converts to UTC.