mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Fix Plex user import to exclude users without server access
Fixes #5064 Add a condition to filter out users without a `<Server>` entry in the `ImportPlexUsers` method. * Update the `ImportPlexUsers` method to check for the presence of a `<Server>` entry before importing a user. * Log a message when skipping a user due to lack of server access. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Ombi-app/Ombi/issues/5064?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
parent
72af4f734d
commit
34ac03c352
1 changed files with 8 additions and 0 deletions
|
@ -143,6 +143,14 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
_log.LogWarning($"Cannot add user {plexUser.Username} because their email address is already in Ombi, skipping this user");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if the user has a <Server> entry
|
||||
if (plexUser.Server == null || !plexUser.Server.Any())
|
||||
{
|
||||
_log.LogInformation($"Skipping user {plexUser.Username} because they do not have access to any servers.");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create this users
|
||||
// We do not store a password against the user since they will authenticate via Plex
|
||||
var newUser = new OmbiUser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue