From b576ae813d6be225e9bfde3fd1cc19881f6bb79e Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Tue, 17 Jan 2017 13:47:11 -0500 Subject: [PATCH] Fix publish date #239 --- .../Indexers/TorrentPotato/TorrentPotatoParser.cs | 5 +++-- .../Indexers/TorrentPotato/TorrentPotatoResponse.cs | 2 +- src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs | 8 +++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs index 2cb91c733..54b5f23c4 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Net; using System.Text.RegularExpressions; using NzbDrone.Common.Http; @@ -36,7 +37,7 @@ namespace NzbDrone.Core.Indexers.TorrentPotato torrentInfo.Size = (long)torrent.size*1000*1000; torrentInfo.DownloadUrl = torrent.download_url; torrentInfo.InfoUrl = torrent.details_url; - torrentInfo.PublishDate = torrent.publishdate.ToUniversalTime(); + torrentInfo.PublishDate = torrent.publish_date.ToUniversalTime(); torrentInfo.Seeders = torrent.seeders; torrentInfo.Peers = torrent.leechers + torrent.seeders; torrentInfo.Freeleech = torrent.freeleech; diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs index b0551ca67..ef4cc4f0b 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoResponse.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Indexers.TorrentPotato public int size { get; set; } public int leechers { get; set; } public int seeders { get; set; } - public DateTime publishdate { get; set; } + public DateTime publish_date { get; set; } } } diff --git a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs index 27ad87129..33edfeeb1 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs @@ -39,7 +39,13 @@ namespace NzbDrone.Core.Indexers.Torznab protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo) { var torrentInfo = base.ProcessItem(item, releaseInfo) as TorrentInfo; - torrentInfo.ImdbId = int.Parse(GetImdbId(item).Substring(2)); + if (GetImdbId(item) != null) + { + if (torrentInfo != null) + { + torrentInfo.ImdbId = int.Parse(GetImdbId(item).Substring(2)); + } + } return torrentInfo; }