mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
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.
This commit is contained in:
parent
de003b9774
commit
7e946277bb
16
NzbDrone.Core/Model/IndexerType.cs
Normal file
16
NzbDrone.Core/Model/IndexerType.cs
Normal file
@ -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 @@ protected IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seas
|
||||
/// </summary>
|
||||
protected abstract string[] Urls { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the credential.
|
||||
/// </summary>
|
||||
@ -58,7 +57,6 @@ protected virtual NetworkCredential Credentials
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
public IndexerSetting Settings
|
||||
{
|
||||
get
|
||||
@ -189,7 +187,8 @@ internal void ProcessItem(SyndicationItem feedItem)
|
||||
EpisodeId = episode.EpisodeId,
|
||||
IsProper = parseResult.Proper,
|
||||
NzbTitle = feedItem.Title.Text,
|
||||
Quality = parseResult.Quality
|
||||
Quality = parseResult.Quality,
|
||||
Indexer = GetIndexerType()
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -246,6 +245,15 @@ protected virtual EpisodeParseResult CustomParser(SyndicationItem item, EpisodeP
|
||||
/// <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 @@ protected override EpisodeParseResult CustomParser(SyndicationItem item, Episode
|
||||
|
||||
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 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
||||
{
|
||||
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 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
||||
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 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
||||
{
|
||||
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 @@ public class History
|
||||
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…
Reference in New Issue
Block a user