mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
#2750 stuff
This commit is contained in:
parent
5d9e6bd113
commit
117bd1cd8b
4 changed files with 20 additions and 22 deletions
|
@ -158,7 +158,7 @@ namespace Ombi.Core.Authentication
|
||||||
if (!email.Equals(result.User?.Email))
|
if (!email.Equals(result.User?.Email))
|
||||||
{
|
{
|
||||||
user.Email = result.User?.Email;
|
user.Email = result.User?.Email;
|
||||||
await UpdateAsync(user);
|
await GlobalMutex.Lock(async () => await UpdateAsync(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -134,28 +134,28 @@ namespace Ombi.DependencyInjection
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RegisterStore(this IServiceCollection services) {
|
public static void RegisterStore(this IServiceCollection services) {
|
||||||
services.AddEntityFrameworkSqlite().AddDbContext<OmbiContext>();
|
services.AddDbContext<OmbiContext>();
|
||||||
services.AddEntityFrameworkSqlite().AddDbContext<SettingsContext>();
|
services.AddDbContext<SettingsContext>();
|
||||||
services.AddEntityFrameworkSqlite().AddDbContext<ExternalContext>();
|
services.AddDbContext<ExternalContext>();
|
||||||
|
|
||||||
services.AddScoped<IOmbiContext, OmbiContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
services.AddScoped<IOmbiContext, OmbiContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
||||||
services.AddScoped<ISettingsContext, SettingsContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
services.AddScoped<ISettingsContext, SettingsContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
||||||
services.AddScoped<IExternalContext, ExternalContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
services.AddScoped<IExternalContext, ExternalContext>(); // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
|
||||||
services.AddTransient<ISettingsRepository, SettingsJsonRepository>();
|
services.AddScoped<ISettingsRepository, SettingsJsonRepository>();
|
||||||
services.AddTransient<ISettingsResolver, SettingsResolver>();
|
services.AddScoped<ISettingsResolver, SettingsResolver>();
|
||||||
services.AddTransient<IPlexContentRepository, PlexServerContentRepository>();
|
services.AddScoped<IPlexContentRepository, PlexServerContentRepository>();
|
||||||
services.AddTransient<IEmbyContentRepository, EmbyContentRepository>();
|
services.AddScoped<IEmbyContentRepository, EmbyContentRepository>();
|
||||||
services.AddTransient<INotificationTemplatesRepository, NotificationTemplatesRepository>();
|
services.AddScoped<INotificationTemplatesRepository, NotificationTemplatesRepository>();
|
||||||
|
|
||||||
services.AddTransient<ITvRequestRepository, TvRequestRepository>();
|
services.AddScoped<ITvRequestRepository, TvRequestRepository>();
|
||||||
services.AddTransient<IMovieRequestRepository, MovieRequestRepository>();
|
services.AddScoped<IMovieRequestRepository, MovieRequestRepository>();
|
||||||
services.AddTransient<IMusicRequestRepository, MusicRequestRepository>();
|
services.AddScoped<IMusicRequestRepository, MusicRequestRepository>();
|
||||||
services.AddTransient<IAuditRepository, AuditRepository>();
|
services.AddScoped<IAuditRepository, AuditRepository>();
|
||||||
services.AddTransient<IApplicationConfigRepository, ApplicationConfigRepository>();
|
services.AddScoped<IApplicationConfigRepository, ApplicationConfigRepository>();
|
||||||
services.AddTransient<ITokenRepository, TokenRepository>();
|
services.AddScoped<ITokenRepository, TokenRepository>();
|
||||||
services.AddTransient(typeof(ISettingsService<>), typeof(SettingsService<>));
|
services.AddScoped(typeof(ISettingsService<>), typeof(SettingsService<>));
|
||||||
services.AddTransient(typeof(IRepository<>), typeof(Repository<>));
|
services.AddScoped(typeof(IRepository<>), typeof(Repository<>));
|
||||||
services.AddTransient(typeof(IExternalRepository<>), typeof(ExternalRepository<>));
|
services.AddScoped(typeof(IExternalRepository<>), typeof(ExternalRepository<>));
|
||||||
}
|
}
|
||||||
public static void RegisterServices(this IServiceCollection services)
|
public static void RegisterServices(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ namespace Ombi.DependencyInjection
|
||||||
services.AddTransient<INotificationService, NotificationService>();
|
services.AddTransient<INotificationService, NotificationService>();
|
||||||
services.AddTransient<IEmailProvider, GenericEmailProvider>();
|
services.AddTransient<IEmailProvider, GenericEmailProvider>();
|
||||||
services.AddTransient<INotificationHelper, NotificationHelper>();
|
services.AddTransient<INotificationHelper, NotificationHelper>();
|
||||||
services.AddTransient<ICacheService, CacheService>();
|
services.AddSingleton<ICacheService, CacheService>();
|
||||||
|
|
||||||
services.AddTransient<IDiscordNotification, DiscordNotification>();
|
services.AddTransient<IDiscordNotification, DiscordNotification>();
|
||||||
services.AddTransient<IEmailNotification, EmailNotification>();
|
services.AddTransient<IEmailNotification, EmailNotification>();
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace Ombi.Store.Context
|
||||||
{
|
{
|
||||||
if (_created) return;
|
if (_created) return;
|
||||||
|
|
||||||
|
|
||||||
_created = true;
|
_created = true;
|
||||||
Database.SetCommandTimeout(60);
|
Database.SetCommandTimeout(60);
|
||||||
Database.Migrate();
|
Database.Migrate();
|
||||||
|
|
|
@ -56,9 +56,6 @@ namespace Ombi
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
// Add framework services.
|
|
||||||
services.AddDbContext<OmbiContext>();
|
|
||||||
|
|
||||||
services.AddIdentity<OmbiUser, IdentityRole>()
|
services.AddIdentity<OmbiUser, IdentityRole>()
|
||||||
.AddEntityFrameworkStores<OmbiContext>()
|
.AddEntityFrameworkStores<OmbiContext>()
|
||||||
.AddDefaultTokenProviders()
|
.AddDefaultTokenProviders()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue