diff --git a/NzbDrone.Core/Providers/Metadata/MetadataBase.cs b/NzbDrone.Core/Providers/Metadata/MetadataBase.cs
new file mode 100644
index 000000000..c312f4c0f
--- /dev/null
+++ b/NzbDrone.Core/Providers/Metadata/MetadataBase.cs
@@ -0,0 +1,52 @@
+using System;
+using NLog;
+using NzbDrone.Core.Model;
+using NzbDrone.Core.Providers.Core;
+using NzbDrone.Core.Repository;
+
+namespace NzbDrone.Core.Providers.Metadata
+{
+ public abstract class MetadataBase
+ {
+ protected readonly Logger _logger;
+ protected readonly ConfigProvider _configProvider;
+
+ protected MetadataBase(ConfigProvider configProvider)
+ {
+ _configProvider = configProvider;
+ _logger = LogManager.GetLogger(GetType().ToString());
+ }
+
+ ///
+ /// Gets the name for the notification provider
+ ///
+ public abstract string Name { get; }
+
+ ///
+ /// Performs the on grab action
+ ///
+ /// The message to send to the receiver
+ public abstract void OnGrab(string message);
+
+ ///
+ /// Performs the on download action
+ ///
+ /// The message to send to the receiver
+ /// The Series for the new download
+ public abstract void OnDownload(string message, Series series);
+
+ ///
+ /// Performs the on rename action
+ ///
+ /// The message to send to the receiver
+ /// The Series for the new download
+ public abstract void OnRename(string message, Series series);
+
+ ///
+ /// Performs the after rename action, this will be handled after all renaming for episode/season/series
+ ///
+ /// The message to send to the receiver
+ /// The Series for the new download
+ public abstract void AfterRename(string message, Series series);
+ }
+}
diff --git a/NzbDrone.Core/Providers/MetadataProvider.cs b/NzbDrone.Core/Providers/MetadataProvider.cs
new file mode 100644
index 000000000..b5200167c
--- /dev/null
+++ b/NzbDrone.Core/Providers/MetadataProvider.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Ninject;
+using NLog;
+using NzbDrone.Core.Model;
+using NzbDrone.Core.Providers.ExternalNotification;
+using NzbDrone.Core.Providers.Metadata;
+using NzbDrone.Core.Repository;
+using PetaPoco;
+
+namespace NzbDrone.Core.Providers
+{
+ public class MetadataProvider
+ {
+ private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
+ private readonly IDatabase _database;
+
+ private IEnumerable _metadataBases;
+
+ [Inject]
+ public MetadataProvider(IDatabase database, IEnumerable metadataBases)
+ {
+ _database = database;
+ _metadataBases = metadataBases;
+ }
+
+ public MetadataProvider()
+ {
+
+ }
+
+ public virtual List All()
+ {
+ return _database.Fetch();
+ }
+
+ public virtual void SaveSettings(MetabaseDefinition settings)
+ {
+ if (settings.Id == 0)
+ {
+ Logger.Debug("Adding Metabase definition for {0}", settings.Name);
+ _database.Insert(settings);
+ }
+
+ else
+ {
+ Logger.Debug("Updating Metabase definition for {0}", settings.Name);
+ _database.Update(settings);
+ }
+ }
+
+ public virtual MetabaseDefinition GetSettings(Type type)
+ {
+ return _database.SingleOrDefault("WHERE MetadataProviderType = @0", type.ToString());
+ }
+
+ public virtual IList GetEnabledExternalNotifiers()
+ {
+ var all = All();
+ return _metadataBases.Where(i => all.Exists(c => c.MetadataProviderType == i.GetType().ToString() && c.Enable)).ToList();
+ }
+
+ public virtual void InitializeNotifiers(IList notifiers)
+ {
+ Logger.Debug("Initializing notifiers. Count {0}", notifiers.Count);
+
+ _metadataBases = notifiers;
+
+ var currentNotifiers = All();
+
+ foreach (var notificationProvider in notifiers)
+ {
+ MetadataBase metadataProviderLocal = notificationProvider;
+ if (!currentNotifiers.Exists(c => c.MetadataProviderType == metadataProviderLocal.GetType().ToString()))
+ {
+ var settings = new MetabaseDefinition
+ {
+ Enable = false,
+ MetadataProviderType = metadataProviderLocal.GetType().ToString(),
+ Name = metadataProviderLocal.Name
+ };
+
+ SaveSettings(settings);
+ }
+ }
+ }
+
+ public virtual void OnGrab(string message)
+ {
+ foreach (var notifier in _metadataBases.Where(i => GetSettings(i.GetType()).Enable))
+ {
+ notifier.OnGrab(message);
+ }
+ }
+
+ public virtual void OnDownload(string message, Series series)
+ {
+ foreach (var notifier in _metadataBases.Where(i => GetSettings(i.GetType()).Enable))
+ {
+ notifier.OnDownload(message, series);
+ }
+ }
+
+ public virtual void OnRename(string message, Series series)
+ {
+ foreach (var notifier in _metadataBases.Where(i => GetSettings(i.GetType()).Enable))
+ {
+ notifier.OnRename(message, series);
+ }
+ }
+
+ public virtual void AfterRename(string message, Series series)
+ {
+ foreach (var notifier in _metadataBases.Where(i => GetSettings(i.GetType()).Enable))
+ {
+ notifier.AfterRename(message, series);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/NzbDrone.Core/Repository/MetabaseDefinition.cs b/NzbDrone.Core/Repository/MetabaseDefinition.cs
new file mode 100644
index 000000000..fce0e67b2
--- /dev/null
+++ b/NzbDrone.Core/Repository/MetabaseDefinition.cs
@@ -0,0 +1,17 @@
+using PetaPoco;
+
+namespace NzbDrone.Core.Repository
+{
+ [TableName("MetabaseDefinitions")]
+ [PrimaryKey("Id", autoIncrement = true)]
+ public class MetabaseDefinition
+ {
+ public int Id { get; set; }
+
+ public bool Enable { get; set; }
+
+ public string MetadataProviderType { get; set; }
+
+ public string Name { get; set; }
+ }
+}
\ No newline at end of file