ombi: fix password reset on default route

the ombi password wasn't being changed w/ password resets initiated
through the admin page (and probably by other routes, too), as the code
was considering a HTTP 204 from Jellyfin as a failure, causing it to
skip anything with Ombi. Also added a little check for Ombi-imported
accounts that probably won't help with anything, but whatever.
This commit is contained in:
Harvey Tindall
2023-10-09 10:40:40 +01:00
parent 4864c6c53c
commit cf94fdb2f0
3 changed files with 56 additions and 34 deletions
+15
View File
@@ -132,3 +132,18 @@ func (app *appContext) DeleteOmbiProfile(gc *gin.Context) {
app.storage.SetProfileKey(profileName, profile)
respondBool(204, true, gc)
}
func (app *appContext) applyOmbiProfile(user map[string]interface{}, profile map[string]interface{}) (status int, err error) {
for k, v := range profile {
switch v.(type) {
case map[string]interface{}, []interface{}:
user[k] = v
default:
if v != user[k] {
user[k] = v
}
}
}
status, err = app.ombi.ModifyUser(user)
return
}