mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
discord: also check disabled users in housekeeping daemon
externally disabled users will also be checked and de-roled by the discord daemon.
This commit is contained in:
parent
448955c915
commit
28ca02272c
@ -32,7 +32,7 @@ func (app *appContext) clearDiscord() {
|
|||||||
app.debug.Println(lm.HousekeepingDiscord)
|
app.debug.Println(lm.HousekeepingDiscord)
|
||||||
discordUsers := app.storage.GetDiscord()
|
discordUsers := app.storage.GetDiscord()
|
||||||
for _, discordUser := range discordUsers {
|
for _, discordUser := range discordUsers {
|
||||||
_, _, err := app.jf.UserByID(discordUser.JellyfinID, false)
|
user, _, err := app.jf.UserByID(discordUser.JellyfinID, false)
|
||||||
// Make sure the user doesn't exist, and no other error has occured
|
// Make sure the user doesn't exist, and no other error has occured
|
||||||
switch err.(type) {
|
switch err.(type) {
|
||||||
case mediabrowser.ErrUserNotFound:
|
case mediabrowser.ErrUserNotFound:
|
||||||
@ -40,6 +40,9 @@ func (app *appContext) clearDiscord() {
|
|||||||
app.discord.RemoveRole(discordUser.MethodID().(string))
|
app.discord.RemoveRole(discordUser.MethodID().(string))
|
||||||
app.storage.DeleteDiscordKey(discordUser.JellyfinID)
|
app.storage.DeleteDiscordKey(discordUser.JellyfinID)
|
||||||
default:
|
default:
|
||||||
|
if user.Policy.IsDisabled {
|
||||||
|
app.discord.RemoveRole(discordUser.MethodID().(string))
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user