mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
accounts: invalidate web user cache on changes as well
previously used app.jf.CacheExpiry = time.Now(), now either call app.InvalidateJellyfinCache() (when we only need it to get a user), or app.InvalidateUserCaches() (when the web user list needs to be updated).
This commit is contained in:
@@ -427,7 +427,7 @@ func (app *appContext) EnableDisableUsers(gc *gin.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
app.jf.CacheExpiry = time.Now()
|
||||
app.InvalidateUserCaches()
|
||||
if len(errors["GetUser"]) != 0 || len(errors["SetPolicy"]) != 0 {
|
||||
gc.JSON(500, errors)
|
||||
return
|
||||
@@ -495,7 +495,7 @@ func (app *appContext) DeleteUsers(gc *gin.Context) {
|
||||
}
|
||||
}
|
||||
}
|
||||
app.jf.CacheExpiry = time.Now()
|
||||
app.InvalidateUserCaches()
|
||||
if len(errors) == len(req.Users) {
|
||||
respondBool(500, false, gc)
|
||||
app.err.Printf(lm.FailedDeleteUsers, lm.Jellyfin, errors[req.Users[0]])
|
||||
@@ -1179,7 +1179,7 @@ func (app *appContext) ApplySettings(gc *gin.Context) {
|
||||
|
||||
} else if req.From == "user" {
|
||||
applyingFromType = lm.User
|
||||
app.jf.CacheExpiry = time.Now()
|
||||
app.InvalidateJellyfinCache()
|
||||
user, err := app.jf.UserByID(req.ID, false)
|
||||
if err != nil {
|
||||
app.err.Printf(lm.FailedGetUser, req.ID, lm.Jellyfin, err)
|
||||
|
||||
Reference in New Issue
Block a user