diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs index 13821f5d9..4b684b8ab 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyUserImporter.cs @@ -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) diff --git a/src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs b/src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs index 790052309..15be41ec7 100644 --- a/src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs +++ b/src/Ombi.Schedule/Jobs/Jellyfin/JellyfinUserImporter.cs @@ -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); diff --git a/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs b/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs index c80703f81..05ba3194f 100644 --- a/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs +++ b/src/Ombi.Schedule/Jobs/Plex/PlexUserImporter.cs @@ -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); @@ -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); diff --git a/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs b/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs index 7d0271722..ff6cff278 100644 --- a/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs +++ b/src/Ombi.Settings/Settings/Models/UserManagementSettings.cs @@ -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 DefaultRoles { get; set; } = new List(); public List BannedPlexUserIds { get; set; } = new List(); public List BannedEmbyUserIds { get; set; } = new List(); diff --git a/src/Ombi.Store/Context/OmbiContext.cs b/src/Ombi.Store/Context/OmbiContext.cs index 90e559875..490f352a6 100644 --- a/src/Ombi.Store/Context/OmbiContext.cs +++ b/src/Ombi.Store/Context/OmbiContext.cs @@ -69,6 +69,7 @@ public void Seed() UserName = "Api", UserType = UserType.SystemUser, NormalizedUserName = "API", + StreamingCountry = "US" }); SaveChanges(); tran.Commit();