Skip to content

Commit

Permalink
Fixed the issue with the null streaming country
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Jan 7, 2021
1 parent ea7307a commit de886dd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
ProviderUserId = embyUser.Id,
Alias = isConnectUser ? embyUser.Name : string.Empty,
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit,
StreamingCountry = userManagementSettings.DefaultStreamingCountry
};
var result = await _userManager.CreateAsync(newUser);
if (!result.Succeeded)
Expand Down
3 changes: 2 additions & 1 deletion src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
UserType = UserType.JellyfinUser,
ProviderUserId = jellyfinUser.Id,
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit,
StreamingCountry = userManagementSettings.DefaultStreamingCountry;
};
_log.LogInformation("Creating Jellyfin user {0}", newUser.UserName);
var result = await _userManager.CreateAsync(newUser);
Expand Down
6 changes: 4 additions & 2 deletions src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ await _notification.Clients.Clients(NotificationHub.AdminConnectionIds)
Email = plexUser?.Email ?? string.Empty,
Alias = string.Empty,
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit,
StreamingCountry = userManagementSettings.DefaultStreamingCountry
};
_log.LogInformation("Creating Plex user {0}", newUser.UserName);
var result = await _userManager.CreateAsync(newUser);
Expand Down Expand Up @@ -161,7 +162,8 @@ private async Task ImportAdmin(UserManagementSettings settings, PlexServers serv
UserName = plexAdmin.username ?? plexAdmin.id,
ProviderUserId = plexAdmin.id,
Email = plexAdmin.email ?? string.Empty,
Alias = string.Empty
Alias = string.Empty,
StreamingCountry = settings.DefaultStreamingCountry;
};

var result = await _userManager.CreateAsync(newUser);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class UserManagementSettings : Settings
public bool ImportJellyfinUsers { get; set; }
public int MovieRequestLimit { get; set; }
public int EpisodeRequestLimit { get; set; }
public string DefaultStreamingCountry { get; set; } = "US";
public List<string> DefaultRoles { get; set; } = new List<string>();
public List<string> BannedPlexUserIds { get; set; } = new List<string>();
public List<string> BannedEmbyUserIds { get; set; } = new List<string>();
Expand Down
1 change: 1 addition & 0 deletions src/Ombi.Store/Context/OmbiContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public void Seed()
UserName = "Api",
UserType = UserType.SystemUser,
NormalizedUserName = "API",
StreamingCountry = "US"
});
SaveChanges();
tran.Commit();
Expand Down

0 comments on commit de886dd

Please sign in to comment.