@ -32,6 +32,7 @@ using Ombi.Api.CouchPotato;
using Ombi.Api.DogNzb ;
using Ombi.Api.FanartTv ;
using Ombi.Api.Github ;
using Ombi.Api.Gotify ;
using Ombi.Api.Lidarr ;
using Ombi.Api.Mattermost ;
using Ombi.Api.Notifications ;
@ -60,6 +61,7 @@ using Ombi.Schedule.Jobs.Plex.Interfaces;
using Ombi.Schedule.Jobs.SickRage ;
using Ombi.Schedule.Processor ;
using Ombi.Store.Entities ;
using Quartz.Spi ;
namespace Ombi.DependencyInjection
{
@ -120,6 +122,7 @@ namespace Ombi.DependencyInjection
services . AddTransient < IOmbiService , OmbiService > ( ) ;
services . AddTransient < IFanartTvApi , FanartTvApi > ( ) ;
services . AddTransient < IPushoverApi , PushoverApi > ( ) ;
services . AddTransient < IGotifyApi , GotifyApi > ( ) ;
services . AddTransient < IMattermostApi , MattermostApi > ( ) ;
services . AddTransient < ICouchPotatoApi , CouchPotatoApi > ( ) ;
services . AddTransient < IDogNzbApi , DogNzbApi > ( ) ;
@ -132,28 +135,28 @@ namespace Ombi.DependencyInjection
}
public static void RegisterStore ( this IServiceCollection services ) {
services . Add EntityFrameworkSqlite( ) . Add DbContext< OmbiContext > ( ) ;
services . Add EntityFrameworkSqlite( ) . Add DbContext< SettingsContext > ( ) ;
services . Add EntityFrameworkSqlite( ) . Add DbContext< ExternalContext > ( ) ;
services . Add DbContext< OmbiContext > ( ) ;
services . Add DbContext< SettingsContext > ( ) ;
services . Add DbContext< ExternalContext > ( ) ;
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 < IExternalContext , ExternalContext > ( ) ; // https://docs.microsoft.com/en-us/aspnet/core/data/entity-framework-6
services . Add Transient < ISettingsRepository , SettingsJsonRepository > ( ) ;
services . Add Transient < ISettingsResolver , SettingsResolver > ( ) ;
services . Add Transient < IPlexContentRepository , PlexServerContentRepository > ( ) ;
services . Add Transient < IEmbyContentRepository , EmbyContentRepository > ( ) ;
services . Add Transient < INotificationTemplatesRepository , NotificationTemplatesRepository > ( ) ;
services . Add Scoped < ISettingsRepository , SettingsJsonRepository > ( ) ;
services . Add Scoped < ISettingsResolver , SettingsResolver > ( ) ;
services . Add Scoped < IPlexContentRepository , PlexServerContentRepository > ( ) ;
services . Add Scoped < IEmbyContentRepository , EmbyContentRepository > ( ) ;
services . Add Scoped < INotificationTemplatesRepository , NotificationTemplatesRepository > ( ) ;
services . Add Transient < ITvRequestRepository , TvRequestRepository > ( ) ;
services . Add Transient < IMovieRequestRepository , MovieRequestRepository > ( ) ;
services . Add Transient < IMusicRequestRepository , MusicRequestRepository > ( ) ;
services . Add Transient < IAuditRepository , AuditRepository > ( ) ;
services . Add Transient < IApplicationConfigRepository , ApplicationConfigRepository > ( ) ;
services . Add Transient < ITokenRepository , TokenRepository > ( ) ;
services . Add Transient ( typeof ( ISettingsService < > ) , typeof ( SettingsService < > ) ) ;
services . Add Transient ( typeof ( IRepository < > ) , typeof ( Repository < > ) ) ;
services . Add Transient ( typeof ( IExternalRepository < > ) , typeof ( ExternalRepository < > ) ) ;
services . Add Scoped < ITvRequestRepository , TvRequestRepository > ( ) ;
services . Add Scoped < IMovieRequestRepository , MovieRequestRepository > ( ) ;
services . Add Scoped < IMusicRequestRepository , MusicRequestRepository > ( ) ;
services . Add Scoped < IAuditRepository , AuditRepository > ( ) ;
services . Add Scoped < IApplicationConfigRepository , ApplicationConfigRepository > ( ) ;
services . Add Scoped < ITokenRepository , TokenRepository > ( ) ;
services . Add Scoped ( typeof ( ISettingsService < > ) , typeof ( SettingsService < > ) ) ;
services . Add Scoped ( typeof ( IRepository < > ) , typeof ( Repository < > ) ) ;
services . Add Scoped ( typeof ( IExternalRepository < > ) , typeof ( ExternalRepository < > ) ) ;
}
public static void RegisterServices ( this IServiceCollection services )
{
@ -161,7 +164,7 @@ namespace Ombi.DependencyInjection
services . AddTransient < INotificationService , NotificationService > ( ) ;
services . AddTransient < IEmailProvider , GenericEmailProvider > ( ) ;
services . AddTransient < INotificationHelper , NotificationHelper > ( ) ;
services . Add Transient < ICacheService , CacheService > ( ) ;
services . Add Singleton < ICacheService , CacheService > ( ) ;
services . AddTransient < IDiscordNotification , DiscordNotification > ( ) ;
services . AddTransient < IEmailNotification , EmailNotification > ( ) ;
@ -170,6 +173,7 @@ namespace Ombi.DependencyInjection
services . AddTransient < ISlackNotification , SlackNotification > ( ) ;
services . AddTransient < IMattermostNotification , MattermostNotification > ( ) ;
services . AddTransient < IPushoverNotification , PushoverNotification > ( ) ;
services . AddTransient < IGotifyNotification , GotifyNotification > ( ) ;
services . AddTransient < ITelegramNotification , TelegramNotification > ( ) ;
services . AddTransient < IMobileNotification , MobileNotification > ( ) ;
services . AddTransient < IChangeLogProcessor , ChangeLogProcessor > ( ) ;
@ -177,6 +181,7 @@ namespace Ombi.DependencyInjection
public static void RegisterJobs ( this IServiceCollection services )
{
services . AddSingleton < IJobFactory , IoCJobFactory > ( provider = > new IoCJobFactory ( provider ) ) ;
services . AddTransient < IBackgroundJobClient , BackgroundJobClient > ( ) ;
services . AddTransient < IPlexContentSync , PlexContentSync > ( ) ;
@ -197,7 +202,7 @@ namespace Ombi.DependencyInjection
services . AddTransient < ISickRageSync , SickRageSync > ( ) ;
services . AddTransient < IRefreshMetadata , RefreshMetadata > ( ) ;
services . AddTransient < INewsletterJob , NewsletterJob > ( ) ;
services . AddTransient < IPlexRecentlyAddedSync , PlexRecentlyAddedSync > ( ) ;
//services.AddTransient<IPlexRecentlyAddedSync, PlexRecentlyAddedSync>() ;
services . AddTransient < ILidarrAlbumSync , LidarrAlbumSync > ( ) ;
services . AddTransient < ILidarrArtistSync , LidarrArtistSync > ( ) ;
services . AddTransient < ILidarrAvailabilityChecker , LidarrAvailabilityChecker > ( ) ;