IndexerType added, this will store the source indexer in history, so users can see (if they care) and we can add an icon if we want.

pull/4/head
Mark McDowall 14 years ago
parent de003b9774
commit 7e946277bb

@ -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
}
}

@ -166,6 +166,7 @@
<Compile Include="Instrumentation\SubsonicTarget.cs" />
<Compile Include="Instrumentation\ExceptioneerTarget.cs" />
<Compile Include="Instrumentation\NlogWriter.cs" />
<Compile Include="Model\IndexerType.cs" />
<Compile Include="Model\SabnzbdInfoModel.cs" />
<Compile Include="Providers\Indexer\SyndicationFeedXmlReader.cs" />
<Compile Include="Providers\AutoConfigureProvider.cs" />

@ -49,7 +49,6 @@ namespace NzbDrone.Core.Providers.Indexer
/// </summary>
protected abstract string[] Urls { get; }
/// <summary>
/// Gets the credential.
/// </summary>
@ -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
/// <returns>Download link URL</returns>
protected abstract string NzbDownloadUrl(SyndicationItem item);
/// <summary>
/// Gets he IndexerType Enum for this indexer
/// </summary>
/// <returns>IndexerType Enum</returns>
protected virtual IndexerType GetIndexerType()
{
return IndexerType.Other;
}
private bool InHistory(IList<Episode> episodes, EpisodeParseResult parseResult, SyndicationItem feedItem)
{
foreach (var episode in episodes)

@ -52,5 +52,10 @@ namespace NzbDrone.Core.Providers.Indexer
return currentResult;
}
protected override IndexerType GetIndexerType()
{
return IndexerType.Newzbin;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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;
}
}
}

@ -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; }

Loading…
Cancel
Save