profiles: fix application
moving to a DB meant empty slices in the Configuration & Policy structs were being stored as null, and striking a nerve with Jellyfin. Mediabrowser library change fixed that by de-nulling them itself, and a new bool field called "Homescreen" is now used to decide if a profile has a homescreen layout stored or not. This field is hopefully correctly filled in during migration.
This commit is contained in:
@@ -330,6 +330,9 @@ func (st *Storage) GetProfileKey(k string) (Profile, bool) {
|
||||
// fmt.Printf("Failed to find profile: %v\n", err)
|
||||
ok = false
|
||||
}
|
||||
if result.Policy.BlockedTags == nil {
|
||||
result.Policy.BlockedTags = []interface{}{}
|
||||
}
|
||||
return result, ok
|
||||
}
|
||||
|
||||
@@ -471,6 +474,7 @@ type Profile struct {
|
||||
Admin bool `json:"admin,omitempty" badgerhold:"index"`
|
||||
LibraryAccess string `json:"libraries,omitempty"`
|
||||
FromUser string `json:"fromUser,omitempty"`
|
||||
Homescreen bool `json:"homescreen"`
|
||||
Policy mediabrowser.Policy `json:"policy,omitempty"`
|
||||
Configuration mediabrowser.Configuration `json:"configuration,omitempty"`
|
||||
Displayprefs map[string]interface{} `json:"displayprefs,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user