|
|
@ -1,6 +1,7 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
|
|
|
|
using NzbDrone.Core.Indexers;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Parser.Augmenters
|
|
|
|
namespace NzbDrone.Core.Parser.Augmenters
|
|
|
@ -8,6 +9,13 @@ namespace NzbDrone.Core.Parser.Augmenters
|
|
|
|
public class AugmentWithReleaseInfo : IAugmentParsedMovieInfo
|
|
|
|
public class AugmentWithReleaseInfo : IAugmentParsedMovieInfo
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
private readonly IIndexerFactory _indexerFactory;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AugmentWithReleaseInfo(IIndexerFactory indexerFactory)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_indexerFactory = indexerFactory;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Type HelperType
|
|
|
|
public Type HelperType
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get
|
|
|
|
get
|
|
|
@ -18,17 +26,23 @@ namespace NzbDrone.Core.Parser.Augmenters
|
|
|
|
|
|
|
|
|
|
|
|
public ParsedMovieInfo AugmentMovieInfo(ParsedMovieInfo movieInfo, object helper)
|
|
|
|
public ParsedMovieInfo AugmentMovieInfo(ParsedMovieInfo movieInfo, object helper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var releaseInfo = helper as ReleaseInfo;
|
|
|
|
if (helper is ReleaseInfo releaseInfo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (releaseInfo != null)
|
|
|
|
IIndexerSettings indexerSettings = null;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
indexerSettings = _indexerFactory.Get(releaseInfo.IndexerId)?.Settings as IIndexerSettings;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// First, let's augment the language!
|
|
|
|
//_logger.Debug("Indexer with id {0} does not exist, skipping minimum seeder checks.", subject.Release.IndexerId);
|
|
|
|
|
|
|
|
} // First, let's augment the language!
|
|
|
|
var languageTitle = movieInfo.SimpleReleaseTitle;
|
|
|
|
var languageTitle = movieInfo.SimpleReleaseTitle;
|
|
|
|
if (movieInfo.MovieTitle.IsNotNullOrWhiteSpace())
|
|
|
|
if (movieInfo.MovieTitle.IsNotNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (languageTitle.ToLower().Contains("multi") && releaseInfo?.IndexerSettings?.MultiLanguages?.Any() == true)
|
|
|
|
if (languageTitle.ToLower().Contains("multi") && indexerSettings?.MultiLanguages?.Any() == true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var i in releaseInfo.IndexerSettings.MultiLanguages)
|
|
|
|
foreach (var i in indexerSettings.MultiLanguages)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var language = (Language) i;
|
|
|
|
var language = (Language) i;
|
|
|
|
if (!movieInfo.Languages.Contains(language))
|
|
|
|
if (!movieInfo.Languages.Contains(language))
|
|
|
|