Added ExternalNotificationProviderBase based on IndexProviderBase.

This commit is contained in:
Mark McDowall 2011-04-28 23:06:13 -07:00
commit a36d5fae2f
16 changed files with 336 additions and 97 deletions

View file

@ -9,6 +9,7 @@ using NLog;
using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Providers;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Providers.ExternalNotification;
using NzbDrone.Core.Providers.Indexer;
using NzbDrone.Core.Providers.Jobs;
using NzbDrone.Core.Repository;
@ -112,11 +113,10 @@ namespace NzbDrone.Core
BindIndexers();
BindJobs();
BindExternalNotifications();
}
}
private static void BindIndexers()
{
_kernel.Bind<IndexerProviderBase>().To<NzbsOrgProvider>().InSingletonScope();
@ -138,6 +138,12 @@ namespace NzbDrone.Core
_kernel.Get<WebTimer>().StartTimer(30);
}
private static void BindExternalNotifications()
{
_kernel.Bind<ExternalNotificationProviderBase>().To<XbmcNotificationProvider>().InSingletonScope();
var notifiers = _kernel.GetAll<ExternalNotificationProviderBase>();
_kernel.Get<ExternalNotificationProvider>().InitializeNotifiers(notifiers.ToList());
}
private static void ForceMigration(IRepository repository)
{
@ -232,7 +238,5 @@ namespace NzbDrone.Core
repository.Update(hd);
}
}
}
}