Fixed: Removed Eztv-like api support entirely since TorrentRss is now available.

pull/4/head
Taloth Saldono 10 years ago
parent 77e9493ccf
commit c9d0bc7148

@ -1,57 +0,0 @@
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Eztv;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using System;
using System.Linq;
using FluentAssertions;
namespace NzbDrone.Core.Test.IndexerTests.EztvTests
{
[TestFixture]
public class EztvFixture : CoreTest<Eztv>
{
[SetUp]
public void Setup()
{
Subject.Definition = new IndexerDefinition()
{
Name = "Eztv",
Settings = new EztvSettings { BaseUrl = "https://www.ezrss.it/" }
};
}
[Test]
public void should_parse_recent_feed_from_Eztv()
{
var recentFeed = ReadAllText(@"Files/Indexers/Eztv/Eztv.xml");
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
var releases = Subject.FetchRecent();
releases.Should().HaveCount(3);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = releases.First() as TorrentInfo;
torrentInfo.Title.Should().Be("S4C I Grombil Cyfandir Pell American Interior [PDTV - MVGROUP]");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("http://re.zoink.it/20a4ed4eFC");
torrentInfo.InfoUrl.Should().Be("http://eztv.it/ep/58439/s4c-i-grombil-cyfandir-pell-american-interior-pdtv-x264-mvgroup/");
torrentInfo.CommentUrl.Should().Be("http://eztv.it/forum/discuss/58439/");
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2014/09/15 18:39:00"));
torrentInfo.Size.Should().Be(796606175);
torrentInfo.InfoHash.Should().Be("20FC4FBFA88272274AC671F857CC15144E9AA83E");
torrentInfo.MagnetUrl.Should().Be("magnet:?xt=urn:btih:ED6E7P5IQJZCOSWGOH4FPTAVCRHJVKB6&dn=S4C.I.Grombil.Cyfandir.Pell.American.Interior.PDTV.x264-MVGroup");
torrentInfo.Peers.Should().NotHaveValue();
torrentInfo.Seeders.Should().NotHaveValue();
}
}
}

@ -4,7 +4,6 @@ using FluentAssertions;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Eztv;
using NzbDrone.Core.Indexers.Fanzub; using NzbDrone.Core.Indexers.Fanzub;
using NzbDrone.Core.Indexers.KickassTorrents; using NzbDrone.Core.Indexers.KickassTorrents;
using NzbDrone.Core.Indexers.Nyaa; using NzbDrone.Core.Indexers.Nyaa;
@ -126,24 +125,6 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
ValidateTorrentResult(result, hasSize: true, hasMagnet: true); ValidateTorrentResult(result, hasSize: true, hasMagnet: true);
} }
[Test]
public void eztv_fetch_recent()
{
Assert.Inconclusive("Eztv Down");
var indexer = Mocker.Resolve<Eztv>();
indexer.Definition = new IndexerDefinition
{
Name = "MyIndexer",
Settings = new EztvSettings()
};
var result = indexer.FetchRecent();
ValidateTorrentResult(result, hasSize: true, hasMagnet: true);
}
[Test] [Test]
public void nyaa_fetch_recent() public void nyaa_fetch_recent()
{ {

@ -71,9 +71,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
} }
[Test] [Test]
public void should_parse_recent_feed_from_Eztv() public void should_parse_recent_feed_from_Ezrss()
{ {
GivenRecentFeedResponse("Eztv/Eztv.xml"); GivenRecentFeedResponse("TorrentRss/Ezrss.xml");
var releases = Subject.FetchRecent(); var releases = Subject.FetchRecent();

@ -34,9 +34,9 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
} }
[Test] [Test]
public void should_detect_rss_settings_for_eztv() public void should_detect_rss_settings_for_ezrss()
{ {
GivenRecentFeedResponse("Eztv/Eztv.xml"); GivenRecentFeedResponse("TorrentRss/Ezrss.xml");
var settings = Subject.Detect(_indexerSettings); var settings = Subject.Detect(_indexerSettings);

@ -209,7 +209,6 @@
<Compile Include="IndexerTests\BasicRssParserFixture.cs" /> <Compile Include="IndexerTests\BasicRssParserFixture.cs" />
<Compile Include="IndexerTests\BitMeTvTests\BitMeTvFixture.cs" /> <Compile Include="IndexerTests\BitMeTvTests\BitMeTvFixture.cs" />
<Compile Include="IndexerTests\BroadcastheNetTests\BroadcastheNetFixture.cs" /> <Compile Include="IndexerTests\BroadcastheNetTests\BroadcastheNetFixture.cs" />
<Compile Include="IndexerTests\EztvTests\EztvFixture.cs" />
<Compile Include="IndexerTests\HDBitsTests\HDBitsFixture.cs" /> <Compile Include="IndexerTests\HDBitsTests\HDBitsFixture.cs" />
<Compile Include="IndexerTests\IndexerServiceFixture.cs" /> <Compile Include="IndexerTests\IndexerServiceFixture.cs" />
<Compile Include="IndexerTests\IntegrationTests\IndexerIntegrationTests.cs" /> <Compile Include="IndexerTests\IntegrationTests\IndexerIntegrationTests.cs" />
@ -406,7 +405,7 @@
<Content Include="Files\Indexers\Fanzub\fanzub.xml"> <Content Include="Files\Indexers\Fanzub\fanzub.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Files\Indexers\Eztv\Eztv.xml"> <Content Include="Files\Indexers\TorrentRss\Ezrss.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>

@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(87)]
public class remove_eztv : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.Sql("DELETE FROM Indexers WHERE Implementation = 'Eztv'");
}
}
}

@ -1,36 +0,0 @@
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Parser;
using NLog;
namespace NzbDrone.Core.Indexers.Eztv
{
public class Eztv : HttpIndexerBase<EztvSettings>
{
public override string Name
{
get
{
return "EZTV";
}
}
public override DownloadProtocol Protocol { get { return DownloadProtocol.Torrent; } }
public Eztv(IHttpClient httpClient, IConfigService configService, IParsingService parsingService, Logger logger)
: base(httpClient, configService, parsingService, logger)
{
}
public override IIndexerRequestGenerator GetRequestGenerator()
{
return new EztvRequestGenerator() { Settings = Settings };
}
public override IParseIndexerResponse GetParser()
{
return new EzrssTorrentRssParser();
}
}
}

@ -1,77 +0,0 @@
using System;
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers.Eztv
{
public class EztvRequestGenerator : IIndexerRequestGenerator
{
public EztvSettings Settings { get; set; }
public EztvRequestGenerator()
{
}
public virtual IList<IEnumerable<IndexerRequest>> GetRecentRequests()
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
pageableRequests.AddIfNotNull(GetPagedRequests("/feed/"));
return pageableRequests;
}
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
pageableRequests.AddIfNotNull(GetPagedRequests(String.Format("/search/index.php?show_name={0}&season={1}&episode={2}&mode=rss",
queryTitle,
searchCriteria.SeasonNumber,
searchCriteria.EpisodeNumber)));
}
return pageableRequests;
}
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
pageableRequests.AddIfNotNull(GetPagedRequests(String.Format("/search/index.php?show_name={0}&season={1}&mode=rss",
queryTitle,
searchCriteria.SeasonNumber)));
}
return pageableRequests;
}
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
//EZTV doesn't support searching based on actual episode airdate. they only support release date.
return new List<IEnumerable<IndexerRequest>>();
}
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new List<IEnumerable<IndexerRequest>>();
}
public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new List<IEnumerable<IndexerRequest>>();
}
private IEnumerable<IndexerRequest> GetPagedRequests(String query)
{
yield return new IndexerRequest(Settings.BaseUrl.TrimEnd('/') + query, HttpAccept.Rss);
}
}
}

@ -1,34 +0,0 @@
using System;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.Eztv
{
public class EztvSettingsValidator : AbstractValidator<EztvSettings>
{
public EztvSettingsValidator()
{
RuleFor(c => c.BaseUrl).ValidRootUrl();
}
}
public class EztvSettings : IProviderConfig
{
private static readonly EztvSettingsValidator Validator = new EztvSettingsValidator();
public EztvSettings()
{
BaseUrl = "";
}
[FieldDefinition(0, Label = "Website URL", HelpText = "Enter to URL to an EZTV compatible RSS feed")]
public String BaseUrl { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}

@ -241,6 +241,7 @@
<Compile Include="Datastore\Migration\060_remove_enable_from_indexers.cs" /> <Compile Include="Datastore\Migration\060_remove_enable_from_indexers.cs" />
<Compile Include="Datastore\Migration\062_convert_quality_models.cs" /> <Compile Include="Datastore\Migration\062_convert_quality_models.cs" />
<Compile Include="Datastore\Migration\065_make_scene_numbering_nullable.cs" /> <Compile Include="Datastore\Migration\065_make_scene_numbering_nullable.cs" />
<Compile Include="Datastore\Migration\087_remove_eztv.cs" />
<Compile Include="Datastore\Migration\078_add_commands_table.cs" /> <Compile Include="Datastore\Migration\078_add_commands_table.cs" />
<Compile Include="Datastore\Migration\068_add_release_restrictions.cs" /> <Compile Include="Datastore\Migration\068_add_release_restrictions.cs" />
<Compile Include="Datastore\Migration\066_add_tags.cs" /> <Compile Include="Datastore\Migration\066_add_tags.cs" />
@ -473,9 +474,6 @@
<Compile Include="Indexers\Exceptions\RequestLimitReachedException.cs" /> <Compile Include="Indexers\Exceptions\RequestLimitReachedException.cs" />
<Compile Include="Indexers\Exceptions\UnsupportedFeedException.cs" /> <Compile Include="Indexers\Exceptions\UnsupportedFeedException.cs" />
<Compile Include="Indexers\EzrssTorrentRssParser.cs" /> <Compile Include="Indexers\EzrssTorrentRssParser.cs" />
<Compile Include="Indexers\Eztv\Eztv.cs" />
<Compile Include="Indexers\Eztv\EztvSettings.cs" />
<Compile Include="Indexers\Eztv\EztvRequestGenerator.cs" />
<Compile Include="Indexers\Fanzub\Fanzub.cs" /> <Compile Include="Indexers\Fanzub\Fanzub.cs" />
<Compile Include="Indexers\Fanzub\FanzubRequestGenerator.cs" /> <Compile Include="Indexers\Fanzub\FanzubRequestGenerator.cs" />
<Compile Include="Indexers\Fanzub\FanzubSettings.cs" /> <Compile Include="Indexers\Fanzub\FanzubSettings.cs" />

Loading…
Cancel
Save