diff --git a/NzbDrone.Core/Model/IndexerType.cs b/NzbDrone.Core/Model/IndexerType.cs
new file mode 100644
index 000000000..2d4d6dcd9
--- /dev/null
+++ b/NzbDrone.Core/Model/IndexerType.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace NzbDrone.Core.Model
+{
+ public enum IndexerType
+ {
+ Other = 0,
+ NzbsOrg = 1,
+ NzbMatrix = 2,
+ NzbsRus = 3,
+ Newzbin = 4
+ }
+}
diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj
index 6e715c37e..fa1485f44 100644
--- a/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/NzbDrone.Core/NzbDrone.Core.csproj
@@ -166,6 +166,7 @@
+
diff --git a/NzbDrone.Core/Providers/Indexer/IndexerProviderBase.cs b/NzbDrone.Core/Providers/Indexer/IndexerProviderBase.cs
index a0840ec67..9a88bbfc6 100644
--- a/NzbDrone.Core/Providers/Indexer/IndexerProviderBase.cs
+++ b/NzbDrone.Core/Providers/Indexer/IndexerProviderBase.cs
@@ -49,7 +49,6 @@ namespace NzbDrone.Core.Providers.Indexer
///
protected abstract string[] Urls { get; }
-
///
/// Gets the credential.
///
@@ -58,7 +57,6 @@ namespace NzbDrone.Core.Providers.Indexer
get { return null; }
}
-
public IndexerSetting Settings
{
get
@@ -189,7 +187,8 @@ namespace NzbDrone.Core.Providers.Indexer
EpisodeId = episode.EpisodeId,
IsProper = parseResult.Proper,
NzbTitle = feedItem.Title.Text,
- Quality = parseResult.Quality
+ Quality = parseResult.Quality,
+ Indexer = GetIndexerType()
});
}
}
@@ -246,6 +245,15 @@ namespace NzbDrone.Core.Providers.Indexer
/// Download link URL
protected abstract string NzbDownloadUrl(SyndicationItem item);
+ ///
+ /// Gets he IndexerType Enum for this indexer
+ ///
+ /// IndexerType Enum
+ protected virtual IndexerType GetIndexerType()
+ {
+ return IndexerType.Other;
+ }
+
private bool InHistory(IList episodes, EpisodeParseResult parseResult, SyndicationItem feedItem)
{
foreach (var episode in episodes)
diff --git a/NzbDrone.Core/Providers/Indexer/NewzbinProvider.cs b/NzbDrone.Core/Providers/Indexer/NewzbinProvider.cs
index 843753420..7326b16f3 100644
--- a/NzbDrone.Core/Providers/Indexer/NewzbinProvider.cs
+++ b/NzbDrone.Core/Providers/Indexer/NewzbinProvider.cs
@@ -52,5 +52,10 @@ namespace NzbDrone.Core.Providers.Indexer
return currentResult;
}
+
+ protected override IndexerType GetIndexerType()
+ {
+ return IndexerType.Newzbin;
+ }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/Providers/Indexer/NzbMatrixProvider.cs b/NzbDrone.Core/Providers/Indexer/NzbMatrixProvider.cs
index 371f6d479..ab9a0c5e9 100644
--- a/NzbDrone.Core/Providers/Indexer/NzbMatrixProvider.cs
+++ b/NzbDrone.Core/Providers/Indexer/NzbMatrixProvider.cs
@@ -1,6 +1,7 @@
using System;
using System.Net;
using System.ServiceModel.Syndication;
+using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using SubSonic.Repository;
@@ -36,5 +37,10 @@ namespace NzbDrone.Core.Providers.Indexer
{
return item.Links[0].Uri.ToString();
}
+
+ protected override IndexerType GetIndexerType()
+ {
+ return IndexerType.NzbMatrix;
+ }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/Providers/Indexer/NzbsOrgProvider.cs b/NzbDrone.Core/Providers/Indexer/NzbsOrgProvider.cs
index aa918173e..72146b22d 100644
--- a/NzbDrone.Core/Providers/Indexer/NzbsOrgProvider.cs
+++ b/NzbDrone.Core/Providers/Indexer/NzbsOrgProvider.cs
@@ -1,5 +1,6 @@
using System.Net;
using System.ServiceModel.Syndication;
+using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using SubSonic.Repository;
@@ -33,6 +34,9 @@ namespace NzbDrone.Core.Providers.Indexer
return item.Id;
}
-
+ protected override IndexerType GetIndexerType()
+ {
+ return IndexerType.NzbsOrg;
+ }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/Providers/Indexer/NzbsRUsProvider.cs b/NzbDrone.Core/Providers/Indexer/NzbsRUsProvider.cs
index 1e7001dec..27dd10c7d 100644
--- a/NzbDrone.Core/Providers/Indexer/NzbsRUsProvider.cs
+++ b/NzbDrone.Core/Providers/Indexer/NzbsRUsProvider.cs
@@ -1,5 +1,6 @@
using System.Net;
using System.ServiceModel.Syndication;
+using NzbDrone.Core.Model;
using NzbDrone.Core.Providers.Core;
using SubSonic.Repository;
@@ -36,5 +37,10 @@ namespace NzbDrone.Core.Providers.Indexer
{
return item.Links[0].Uri.ToString();
}
+
+ protected override IndexerType GetIndexerType()
+ {
+ return IndexerType.NzbsRus;
+ }
}
}
\ No newline at end of file
diff --git a/NzbDrone.Core/Repository/History.cs b/NzbDrone.Core/Repository/History.cs
index d4346c3a7..af6f3edb4 100644
--- a/NzbDrone.Core/Repository/History.cs
+++ b/NzbDrone.Core/Repository/History.cs
@@ -1,4 +1,5 @@
using System;
+using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
using SubSonic.SqlGeneration.Schema;
@@ -14,6 +15,7 @@ namespace NzbDrone.Core.Repository
public QualityTypes Quality { get; set; }
public DateTime Date { get; set; }
public bool IsProper { get; set; }
+ public IndexerType? Indexer { get; set; }
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
public virtual Episode Episode { get; protected set; }