@ -1372,7 +1372,9 @@ func (app *appContext) ApplySettings(gc *gin.Context) {
configuration = profile . Configuration
configuration = profile . Configuration
displayprefs = profile . Displayprefs
displayprefs = profile . Displayprefs
}
}
if req . Policy {
policy = profile . Policy
policy = profile . Policy
}
if req . Ombi && app . config . Section ( "ombi" ) . Key ( "enabled" ) . MustBool ( false ) {
if req . Ombi && app . config . Section ( "ombi" ) . Key ( "enabled" ) . MustBool ( false ) {
if profile . Ombi != nil && len ( profile . Ombi ) != 0 {
if profile . Ombi != nil && len ( profile . Ombi ) != 0 {
ombi = profile . Ombi
ombi = profile . Ombi
@ -1394,7 +1396,9 @@ func (app *appContext) ApplySettings(gc *gin.Context) {
return
return
}
}
applyingFrom = "\"" + user . Name + "\""
applyingFrom = "\"" + user . Name + "\""
if req . Policy {
policy = user . Policy
policy = user . Policy
}
if req . Homescreen {
if req . Homescreen {
displayprefs , status , err = app . jf . GetDisplayPreferences ( req . ID )
displayprefs , status , err = app . jf . GetDisplayPreferences ( req . ID )
if ! ( status == 200 || status == 204 ) || err != nil {
if ! ( status == 200 || status == 204 ) || err != nil {
@ -1421,10 +1425,14 @@ func (app *appContext) ApplySettings(gc *gin.Context) {
app . debug . Println ( "Adding delay between requests for large batch" )
app . debug . Println ( "Adding delay between requests for large batch" )
}
}
for _ , id := range req . ApplyTo {
for _ , id := range req . ApplyTo {
status , err := app . jf . SetPolicy ( id , policy )
var status int
var err error
if req . Policy {
status , err = app . jf . SetPolicy ( id , policy )
if ! ( status == 200 || status == 204 ) || err != nil {
if ! ( status == 200 || status == 204 ) || err != nil {
errors [ "policy" ] [ id ] = fmt . Sprintf ( "%d: %s" , status , err )
errors [ "policy" ] [ id ] = fmt . Sprintf ( "%d: %s" , status , err )
}
}
}
if shouldDelay {
if shouldDelay {
time . Sleep ( 250 * time . Millisecond )
time . Sleep ( 250 * time . Millisecond )
}
}