@ -1,6 +1,7 @@
using Hangfire ;
using Ombi.Schedule.Jobs ;
using Ombi.Schedule.Jobs.Emby ;
using Ombi.Schedule.Jobs.Plex ;
using Ombi.Schedule.Jobs.Radarr ;
using Ombi.Schedule.Ombi ;
@ -9,17 +10,19 @@ namespace Ombi.Schedule
public class JobSetup : IJobSetup
{
public JobSetup ( IPlexContentCacher plexContentCacher , IRadarrCacher radarrCacher ,
IOmbiAutomaticUpdater updater , IEmbyContentCacher embyCacher )
IOmbiAutomaticUpdater updater , IEmbyContentCacher embyCacher , IPlexUserImporter userImporter )
{
PlexContentCacher = plexContentCacher ;
RadarrCacher = radarrCacher ;
Updater = updater ;
EmbyContentCacher = embyCacher ;
PlexUserImporter = userImporter ;
}
private IPlexContentCacher PlexContentCacher { get ; }
private IRadarrCacher RadarrCacher { get ; }
private IOmbiAutomaticUpdater Updater { get ; }
private IPlexUserImporter PlexUserImporter { get ; }
private IEmbyContentCacher EmbyContentCacher { get ; }
public void Setup ( )
@ -27,9 +30,10 @@ namespace Ombi.Schedule
RecurringJob . AddOrUpdate ( ( ) = > PlexContentCacher . CacheContent ( ) , Cron . Hourly ) ;
RecurringJob . AddOrUpdate ( ( ) = > EmbyContentCacher . Start ( ) , Cron . Hourly ) ;
RecurringJob . AddOrUpdate ( ( ) = > RadarrCacher . CacheContent ( ) , Cron . Hourly ) ;
//RecurringJob.AddOrUpdate(() => Updater.Update(), Cron.Daily);
RecurringJob . AddOrUpdate ( ( ) = > PlexUserImporter . Start ( ) , Cron . Daily ) ;
RecurringJob . AddOrUpdate ( ( ) = > Updater . Update ( ) , Cron . Daily ) ;
BackgroundJob . Enqueue ( ( ) = > Updater . Update ( ) ) ;
//BackgroundJob.Enqueue(() => PlexUserImporter.Start()) ;
}
}
}