From 9f6c6365b974b985e6d06b1ac14d6801ecaf72cd Mon Sep 17 00:00:00 2001 From: Mircea Roata Date: Sat, 30 Dec 2023 20:48:11 +0200 Subject: [PATCH] Skip serializing default setting values --- backend/settings/settings.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/backend/settings/settings.go b/backend/settings/settings.go index 96dc708c..21955c64 100644 --- a/backend/settings/settings.go +++ b/backend/settings/settings.go @@ -32,26 +32,26 @@ var ( ) type settings struct { - WindowPosition *utils.Position `json:"windowPosition"` - Maximized bool `json:"maximized"` + WindowPosition *utils.Position `json:"windowPosition,omitempty"` + Maximized bool `json:"maximized,omitempty"` - UnexpandedSize utils.Size `json:"unexpandedSize"` - ExpandedSize utils.Size `json:"expandedSize"` + UnexpandedSize utils.Size `json:"unexpandedSize,omitempty"` + ExpandedSize utils.Size `json:"expandedSize,omitempty"` - StartView View `json:"startView"` + StartView View `json:"startView,omitempty"` - FavoriteMods []string `json:"favoriteMods"` - ModFilters SavedModFilters `json:"modFilters"` + FavoriteMods []string `json:"favoriteMods,omitempty"` + ModFilters SavedModFilters `json:"modFilters,omitempty"` - QueueAutoStart bool `json:"queueAutoStart"` - IgnoredUpdates map[string][]string `json:"ignoredUpdates"` - UpdateCheckMode UpdateCheckMode `json:"updateCheckMode"` - ViewedAnnouncements []string `json:"viewedAnnouncements"` + QueueAutoStart bool `json:"queueAutoStart,omitempty"` + IgnoredUpdates map[string][]string `json:"ignoredUpdates,omitempty"` + UpdateCheckMode UpdateCheckMode `json:"updateCheckMode,omitempty"` + ViewedAnnouncements []string `json:"viewedAnnouncements,omitempty"` - Offline bool `json:"offline"` + Offline bool `json:"offline,omitempty"` - Konami bool `json:"konami"` - LaunchButton string `json:"launchButton"` + Konami bool `json:"konami,omitempty"` + LaunchButton string `json:"launchButton,omitempty"` CacheDir string `json:"cacheDir,omitempty"` }