mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
ThirdPartyServices: SetContactMethods for setting, enable/disable
replace AddContactMethods with a more generalised SetContactMethods, which can set (or leave alone) contact method addresses/names/ids and set (or leave alone) contact preferences. A little awkward to use, but works everywhere, and now a bunch of Jellyseerr integration features are present for Ombi (which they should've been anyway).
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/hrfee/jfa-go/ombi"
|
||||
"gopkg.in/ini.v1"
|
||||
)
|
||||
|
||||
@@ -191,7 +192,10 @@ func linkExistingOmbiDiscordTelegram(app *appContext) error {
|
||||
app.debug.Printf("Failed to get Ombi user with Discord/Telegram \"%s\"/\"%s\": %v", ids[0], ids[1], err)
|
||||
continue
|
||||
}
|
||||
_, err = app.ombi.SetNotificationPrefs(ombiUser, ids[0], ids[1])
|
||||
_, err = app.ombi.SetNotificationPrefs(ombiUser, []ombi.NotificationPref{
|
||||
{ombi.NotifAgentDiscord, ombiUser["id"].(string), ids[0], true},
|
||||
{ombi.NotifAgentTelegram, ombiUser["id"].(string), ids[1], true},
|
||||
})
|
||||
if err != nil {
|
||||
app.debug.Printf("Failed to set prefs for Ombi user \"%s\": %v", ombiUser["userName"].(string), err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user