From 806ba7e59d6318bc3af07520d03700f49cdc78d0 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 27 May 2018 22:38:09 +0200 Subject: [PATCH] Fixed: AwesomeHD failing on an empty imdbid. Fixes #2810 --- .../Indexers/AwesomeHD/AwesomeHDRssParser.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRssParser.cs b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRssParser.cs index 7d300bddd..be2b91718 100644 --- a/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRssParser.cs +++ b/src/NzbDrone.Core/Indexers/AwesomeHD/AwesomeHDRssParser.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Xml; using System.Xml.Linq; +using NzbDrone.Common.Extensions; namespace NzbDrone.Core.Indexers.AwesomeHD { @@ -98,6 +99,12 @@ public IList ParseResponse(IndexerResponse indexerResponse) flags |= IndexerFlags.AHD_Internal; } + var imdbId = 0; + if (torrent.ImdbId.Length > 2) + { + imdbId = int.Parse(torrent.ImdbId.Substring(2)); + } + torrentInfos.Add(new TorrentInfo() { Guid = string.Format("AwesomeHD-{0}", id), @@ -108,7 +115,7 @@ public IList ParseResponse(IndexerResponse indexerResponse) Seeders = int.Parse(torrent.Seeders), Peers = int.Parse(torrent.Leechers) + int.Parse(torrent.Seeders), PublishDate = torrent.Time.ToUniversalTime(), - ImdbId = int.Parse(torrent.ImdbId.Substring(2)), + ImdbId = imdbId, IndexerFlags = flags, }); }