mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-23 22:17:15 -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:
parent
d8e0fa6ac2
commit
b254ee548d
1 changed files with 7 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue