mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-27 00:49:41 -05:00
Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: FandacqkaCorp <david@davidyloreto.com> Co-authored-by: FandacqkaCorp <275647464+FandacqkaCorp@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package settings
|
|
|
|
import (
|
|
"github.com/gtsteffaniak/filebrowser/backend/internal/database/users"
|
|
)
|
|
|
|
// UserProfile is the nested profile document stored in SQLite user_data.profile
|
|
// and aligned with admin UserDefaults sections.
|
|
type UserProfile struct {
|
|
Sidebar UserDefaultsSidebar `json:"sidebar,omitempty"`
|
|
Listing UserDefaultsListing `json:"listing,omitempty"`
|
|
Preview UserDefaultsPreview `json:"preview,omitempty"`
|
|
FileViewer UserDefaultsFileViewer `json:"fileViewer,omitempty"`
|
|
Search UserDefaultsSearch `json:"search,omitempty"`
|
|
UI UserDefaultsUI `json:"ui,omitempty"`
|
|
FileLoading users.FileLoading `json:"fileLoading,omitempty"`
|
|
Account UserDefaultsAccount `json:"account,omitempty"`
|
|
}
|
|
|
|
// ProfileFromUserDefaults extracts the profile sections from a defaults template.
|
|
func ProfileFromUserDefaults(d UserDefaults) UserProfile {
|
|
return UserProfile{
|
|
Sidebar: d.Sidebar,
|
|
Listing: d.Listing,
|
|
Preview: d.Preview,
|
|
FileViewer: d.FileViewer,
|
|
Search: d.Search,
|
|
UI: d.UI,
|
|
FileLoading: d.FileLoading,
|
|
Account: d.Account,
|
|
}
|
|
}
|