mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 01:38:24 +00:00
Newzbin override for getting proper and quality.
This commit is contained in:
parent
9028e498ca
commit
64bbf8a9b5
3 changed files with 23 additions and 3 deletions
|
@ -206,7 +206,7 @@ internal static bool ParseProper(string title)
|
|||
return title.ToLower().Contains("proper");
|
||||
}
|
||||
|
||||
private static QualityTypes ParseQuality(string name)
|
||||
internal static QualityTypes ParseQuality(string name)
|
||||
{
|
||||
Logger.Trace("Trying to parse quality for {0}", name);
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ public IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seasonP
|
|||
/// </summary>
|
||||
public abstract string Name { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generates direct link to download an NZB
|
||||
/// </summary>
|
||||
|
@ -50,7 +49,6 @@ public IndexerProviderBase(SeriesProvider seriesProvider, SeasonProvider seasonP
|
|||
/// <returns>Download link URL</returns>
|
||||
protected abstract string NzbDownloadUrl(SyndicationItem item);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parses the RSS feed item and.
|
||||
/// </summary>
|
||||
|
@ -74,6 +72,16 @@ protected EpisodeParseResult ParseFeed(SyndicationItem item)
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method can be overwritten to provide indexer specific info parsing
|
||||
/// </summary>
|
||||
/// <param name="item">RSS item that needs to be parsed</param>
|
||||
/// <param name="currentResult">Result of the built in parse function.</param>
|
||||
/// <returns></returns>
|
||||
protected virtual EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||
{
|
||||
return currentResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches RSS feed and process each news item.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.ServiceModel.Syndication;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using SubSonic.Repository;
|
||||
|
||||
|
@ -32,5 +33,16 @@ protected override string NzbDownloadUrl(SyndicationItem item)
|
|||
{
|
||||
return item.Id;
|
||||
}
|
||||
|
||||
protected override EpisodeParseResult CustomParser(SyndicationItem item, EpisodeParseResult currentResult)
|
||||
{
|
||||
var quality = Parser.ParseQuality(item.Summary.Text);
|
||||
var proper = Parser.ParseProper(item.Summary.Text);
|
||||
|
||||
currentResult.Quality = quality;
|
||||
currentResult.Proper = proper;
|
||||
|
||||
return currentResult;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue