1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-16 21:15:33 -04:00

Fixed: IMDb ID handling for Torznab indexers (#4089)

* Fix IMDb IDs

* Fix type errors

* Attribute is named imdb

* Use TryParse instead

* Use TryParse properly

* Pass out keyword

* Use variable instead of property
This commit is contained in:
Jonas Stendahl
2020-02-11 00:53:22 +01:00
committed by GitHub
parent d8e0fa6ac2
commit b254ee548d

View File

@@ -39,12 +39,12 @@ namespace NzbDrone.Core.Indexers.Torznab
protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo)
{
var torrentInfo = base.ProcessItem(item, releaseInfo) as TorrentInfo;
if (GetImdbId(item) != null)
var imdbId = GetImdbId(item);
int parsedImdbId;
if (imdbId != null && int.TryParse(imdbId, out parsedImdbId))
{
if (torrentInfo != null)
{
torrentInfo.ImdbId = int.Parse(GetImdbId(item).Substring(2));
}
torrentInfo.ImdbId = parsedImdbId;
}
torrentInfo.IndexerFlags = GetFlags(item);
@@ -108,8 +108,8 @@ namespace NzbDrone.Core.Indexers.Torznab
protected virtual string GetImdbId(XElement item)
{
var imdbIdString = TryGetTorznabAttribute(item, "imdbid");
return (!imdbIdString.IsNullOrWhiteSpace() ? imdbIdString.Substring(2) : null);
var imdbId = TryGetTorznabAttribute(item, "imdb");
return (!imdbId.IsNullOrWhiteSpace() ? imdbId : null);
}
protected override string GetInfoHash(XElement item)