Highlight @username, links and emails in descriptions; and some fixes

This commit is contained in:
Laptop
2024-11-24 16:32:33 +02:00
parent ea3426edd9
commit 2ed5d08bbc
12 changed files with 133 additions and 39 deletions

View File

@@ -26,6 +26,10 @@ func Defaults(dst *cfg.Preferences) {
if dst.ProxyImages == nil {
dst.ProxyImages = cfg.DefaultPreferences.ProxyImages
}
if dst.ParseDescriptions == nil {
dst.ParseDescriptions = cfg.DefaultPreferences.ParseDescriptions
}
}
func Get(c *fiber.Ctx) (cfg.Preferences, error) {
@@ -43,6 +47,7 @@ func Get(c *fiber.Ctx) (cfg.Preferences, error) {
type PrefsForm struct {
ProxyImages string
ParseDescriptions string
Player string
ProxyStreams string
FullyPreloadTrack string
@@ -96,6 +101,12 @@ func Load(r fiber.Router) {
old.ProxyImages = &f
}
}
if p.ParseDescriptions == "on" {
old.ParseDescriptions = &t
} else {
old.ParseDescriptions = &f
}
old.Player = &p.Player
data, err := json.Marshal(old)