|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|