diff --git a/housekeeping-d.go b/housekeeping-d.go index b3bba57..1e4c880 100644 --- a/housekeeping-d.go +++ b/housekeeping-d.go @@ -31,6 +31,7 @@ func (app *appContext) clearEmails() { func (app *appContext) clearDiscord() { app.debug.Println(lm.HousekeepingDiscord) discordUsers := app.storage.GetDiscord() + removeRoleOnDisable := app.config.Section("discord").Key("disable_enable_role").MustBool(false) for _, discordUser := range discordUsers { user, err := app.jf.UserByID(discordUser.JellyfinID, false) // Make sure the user doesn't exist, and no other error has occured @@ -40,7 +41,7 @@ func (app *appContext) clearDiscord() { app.discord.RemoveRole(discordUser.MethodID().(string)) app.storage.DeleteDiscordKey(discordUser.JellyfinID) default: - if user.Policy.IsDisabled { + if removeRoleOnDisable && user.Policy.IsDisabled { app.discord.RemoveRole(discordUser.MethodID().(string)) } continue