Allow Obsolete of C# Indexer Implementations

pull/605/head
Qstick 3 years ago
parent 6200c9e496
commit 1abd14ee86

@ -27,7 +27,8 @@ namespace NzbDrone.Core.HealthCheck.Checks
{
var blocklist = _indexerDefinitionUpdateService.GetBlocklist();
var oldIndexers = _indexerFactory.All().Where(i => i.Implementation == "Cardigann" && blocklist.Contains(((CardigannSettings)i.Settings).DefinitionFile)).ToList();
var oldIndexers = _indexerFactory.AllProviders(false)
.Where(i => i.IsObsolete() || (i.Definition.Implementation == "Cardigann" && blocklist.Contains(((CardigannSettings)i.Definition.Settings).DefinitionFile))).ToList();
if (oldIndexers.Count == 0)
{

@ -29,15 +29,11 @@ namespace NzbDrone.Core.IndexerVersions
private const int DEFINITION_VERSION = 3;
private readonly List<string> _defintionBlocklist = new List<string>()
{
"aither",
"animeworld",
"blutopia",
"beyond-hd",
"beyond-hd-oneurl",
"danishbytes",
"desitorrents",
"hdbits",
"shareisland",
"lat-team"
};

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
@ -7,6 +8,7 @@ using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class Aither : Unit3dBase
{
public override string Name => "Aither";

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
@ -7,6 +8,7 @@ using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class AnimeWorld : Unit3dBase
{
public override string Name => "AnimeWorld";

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
@ -7,6 +8,7 @@ using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class Blutopia : Unit3dBase
{
public override string Name => "Blutopia";

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
@ -8,6 +9,7 @@ using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class DesiTorrents : Unit3dBase
{
public override string Name => "DesiTorrents";

@ -20,6 +20,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class DigitalCore : TorrentIndexerBase<DigitalCoreSettings>
{
public override string Name => "DigitalCore";

@ -17,6 +17,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class InternetArchive : TorrentIndexerBase<InternetArchiveSettings>
{
public override string Name => "Internet Archive";

@ -15,6 +15,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class Milkie : TorrentIndexerBase<MilkieSettings>
{
public override string Name => "Milkie";

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using NLog;
using NzbDrone.Common.Http;
@ -7,6 +8,7 @@ using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class ShareIsland : Unit3dBase
{
public override string Name => "ShareIsland";

@ -18,6 +18,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class SuperBits : TorrentIndexerBase<SuperBitsSettings>
{
public override string Name => "SuperBits";

@ -16,6 +16,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class ThePirateBay : TorrentIndexerBase<ThePirateBaySettings>
{
public override string Name => "ThePirateBay";

@ -20,6 +20,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class TorrentLeech : TorrentIndexerBase<TorrentLeechSettings>
{
public override string Name => "TorrentLeech";

@ -18,6 +18,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class TorrentParadiseMl : TorrentIndexerBase<TorrentParadiseMlSettings>
{
public override string Name => "TorrentParadiseMl";

@ -18,6 +18,7 @@ using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Definitions
{
[Obsolete]
public class YTS : TorrentIndexerBase<YTSSettings>
{
public override string Name => "YTS";

@ -27,6 +27,7 @@ namespace NzbDrone.Core.Indexers
Task<IndexerPageableQueryResult> Fetch(BasicSearchCriteria searchCriteria);
Task<byte[]> Download(Uri link);
bool IsObsolete();
IndexerCapabilities GetCapabilities();
}

@ -45,6 +45,18 @@ namespace NzbDrone.Core.Indexers
public Type ConfigContract => typeof(TSettings);
public bool IsObsolete()
{
var attributes = GetType().GetCustomAttributes(false);
foreach (ObsoleteAttribute attribute in attributes.OfType<ObsoleteAttribute>())
{
return true;
}
return false;
}
public virtual ProviderMessage Message => null;
public virtual IEnumerable<ProviderDefinition> DefaultDefinitions

@ -147,6 +147,11 @@ namespace NzbDrone.Core.Indexers
{
foreach (var provider in _providers)
{
if (provider.IsObsolete())
{
continue;
}
var definitions = provider.DefaultDefinitions
.Where(v => v.Name != null && (v.Name != typeof(Cardigann.Cardigann).Name || v.Name != typeof(Newznab.Newznab).Name || v.Name != typeof(Torznab.Torznab).Name));

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using FluentValidation.Results;
@ -11,6 +11,7 @@ namespace NzbDrone.Core.ThingiProvider
ProviderMessage Message { get; }
IEnumerable<ProviderDefinition> DefaultDefinitions { get; }
ProviderDefinition Definition { get; set; }
ValidationResult Test();
object RequestAction(string stage, IDictionary<string, string> query);
}

Loading…
Cancel
Save