Fixed: (TorrentPotato) Update namespace

pull/1609/head
Bogdan 2 years ago
parent 5e8bfa2ffb
commit 245e573089

@ -1,15 +1,14 @@
using System; using System;
using NLog; using NLog;
using NzbDrone.Common.Http;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers.TorrentPotato namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
{ {
public class TorrentPotato : TorrentIndexerBase<TorrentPotatoSettings> public class TorrentPotato : TorrentIndexerBase<TorrentPotatoSettings>
{ {
public override string Name => "TorrentPotato"; public override string Name => "TorrentPotato";
public override string[] IndexerUrls => new string[] { "http://127.0.0.1" }; public override string[] IndexerUrls => new[] { "http://127.0.0.1" };
public override string Description => "A JSON based torrent provider previously developed for CouchPotato"; public override string Description => "A JSON based torrent provider previously developed for CouchPotato";
public override DownloadProtocol Protocol => DownloadProtocol.Torrent; public override DownloadProtocol Protocol => DownloadProtocol.Torrent;

@ -6,7 +6,7 @@ using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers.Exceptions; using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers.TorrentPotato namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
{ {
public class TorrentPotatoParser : IParseIndexerResponse public class TorrentPotatoParser : IParseIndexerResponse
{ {
@ -31,17 +31,18 @@ namespace NzbDrone.Core.Indexers.TorrentPotato
foreach (var torrent in jsonResponse.Resource.results) foreach (var torrent in jsonResponse.Resource.results)
{ {
var torrentInfo = new TorrentInfo(); var torrentInfo = new TorrentInfo
{
torrentInfo.Guid = GetGuid(torrent); Guid = GetGuid(torrent),
torrentInfo.Title = torrent.release_name; Title = torrent.release_name,
torrentInfo.Size = (long)torrent.size * 1000 * 1000; Size = (long)torrent.size * 1000 * 1000,
torrentInfo.DownloadUrl = torrent.download_url; DownloadUrl = torrent.download_url,
torrentInfo.InfoUrl = torrent.details_url; InfoUrl = torrent.details_url,
torrentInfo.PublishDate = torrent.publish_date.ToUniversalTime(); PublishDate = torrent.publish_date.ToUniversalTime(),
torrentInfo.Seeders = torrent.seeders; Seeders = torrent.seeders,
torrentInfo.Peers = torrent.leechers + torrent.seeders; Peers = torrent.leechers + torrent.seeders,
torrentInfo.Freeleech = torrent.freeleech; Freeleech = torrent.freeleech
};
results.Add(torrentInfo); results.Add(torrentInfo);
} }

@ -4,16 +4,12 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers.TorrentPotato namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
{ {
public class TorrentPotatoRequestGenerator : IIndexerRequestGenerator public class TorrentPotatoRequestGenerator : IIndexerRequestGenerator
{ {
public TorrentPotatoSettings Settings { get; set; } public TorrentPotatoSettings Settings { get; set; }
public TorrentPotatoRequestGenerator()
{
}
public virtual IndexerPageableRequestChain GetRecentRequests() public virtual IndexerPageableRequestChain GetRecentRequests()
{ {
var pageableRequests = new IndexerPageableRequestChain(); var pageableRequests = new IndexerPageableRequestChain();

@ -1,6 +1,6 @@
using System; using System;
namespace NzbDrone.Core.Indexers.TorrentPotato namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
{ {
public class TorrentPotatoResponse public class TorrentPotatoResponse
{ {

@ -3,7 +3,7 @@ using NzbDrone.Core.Annotations;
using NzbDrone.Core.Indexers.Settings; using NzbDrone.Core.Indexers.Settings;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Indexers.TorrentPotato namespace NzbDrone.Core.Indexers.Definitions.TorrentPotato
{ {
public class TorrentPotatoSettingsValidator : NoAuthSettingsValidator<TorrentPotatoSettings> public class TorrentPotatoSettingsValidator : NoAuthSettingsValidator<TorrentPotatoSettings>
{ {

Loading…
Cancel
Save