mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
fix(user-importer): Fixed not importing all correct users #4989
This commit is contained in:
parent
880e511f2b
commit
34c32f8338
3 changed files with 7 additions and 9 deletions
|
@ -16,6 +16,10 @@ namespace Ombi.Api.Plex.Models.Friends
|
|||
public string Username { get; set; }
|
||||
[XmlAttribute(AttributeName = "email")]
|
||||
public string Email { get; set; }
|
||||
/// <summary>
|
||||
/// DO NOT USE THIS
|
||||
/// Home Users can actually be an unmanaged account with an email/username to log in.
|
||||
/// </summary>
|
||||
[XmlAttribute(AttributeName = "home")]
|
||||
public bool HomeUser { get; set; }
|
||||
}
|
||||
|
|
|
@ -65,8 +65,7 @@ namespace Ombi.Api.Plex
|
|||
}
|
||||
|
||||
private const string SignInUri = "https://plex.tv/users/sign_in.json";
|
||||
private const string NewFriendsUri = "https://plex.tv/api/users";
|
||||
private const string FriendsUri = "https://plex.tv/pms/friends/all";
|
||||
private const string FriendsUri = "https://plex.tv/api/users";
|
||||
private const string GetAccountUri = "https://plex.tv/users/account.json";
|
||||
private const string ServerUri = "https://plex.tv/pms/servers.xml";
|
||||
private const string WatchlistUri = "https://metadata.provider.plex.tv/";
|
||||
|
|
|
@ -127,19 +127,14 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
continue;
|
||||
}
|
||||
|
||||
if (plexUser.HomeUser)
|
||||
{
|
||||
_log.LogInformation($"User '{plexUser.Title}' is a Plex Home User. Home Users are not supported");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if this Plex User already exists
|
||||
// We are using the Plex USERNAME and Not the TITLE, the Title is for HOME USERS without an account
|
||||
var existingPlexUser = allUsers.FirstOrDefault(x => x.ProviderUserId == plexUser.Id);
|
||||
if (existingPlexUser == null)
|
||||
{
|
||||
if (!plexUser.Username.HasValue())
|
||||
{
|
||||
_log.LogInformation($"Could not create Plex user since the have no username, PlexUserId: {plexUser.Id}");
|
||||
_log.LogInformation($"Could not create user since the have no username (Probably a Home User), PlexUserId: {plexUser.Id}, Title: {plexUser.Title}");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue