mirror of
https://github.com/Radarr/Radarr
synced 2025-02-25 23:53:14 +00:00
Merge pull request #148 from Radarr/patch/newznab-imdb
search imdbid for usenet indexers that support it
This commit is contained in:
commit
cfe55d00ae
3 changed files with 9 additions and 22 deletions
|
@ -92,7 +92,7 @@ private bool SupportsMovieSearch
|
||||||
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
|
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
|
||||||
|
|
||||||
return capabilities.SupportedMovieSearchParamters != null &&
|
return capabilities.SupportedMovieSearchParamters != null &&
|
||||||
capabilities.SupportedMovieSearchParamters.Contains("imdb");
|
capabilities.SupportedMovieSearchParamters.Contains("imdbid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,7 @@ protected override bool PreProcess(IndexerResponse indexerResponse)
|
||||||
protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo)
|
protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo)
|
||||||
{
|
{
|
||||||
releaseInfo = base.ProcessItem(item, releaseInfo);
|
releaseInfo = base.ProcessItem(item, releaseInfo);
|
||||||
|
releaseInfo.ImdbId = GetImdbId(item);
|
||||||
releaseInfo.TvdbId = GetTvdbId(item);
|
|
||||||
releaseInfo.TvRageId = GetTvRageId(item);
|
|
||||||
|
|
||||||
return releaseInfo;
|
return releaseInfo;
|
||||||
}
|
}
|
||||||
|
@ -114,27 +112,14 @@ protected override string GetDownloadUrl(XElement item)
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual int GetTvdbId(XElement item)
|
protected virtual int GetImdbId(XElement item)
|
||||||
{
|
{
|
||||||
var tvdbIdString = TryGetNewznabAttribute(item, "tvdbid");
|
var imdbIdString = TryGetNewznabAttribute(item, "imdb");
|
||||||
int tvdbId;
|
int imdbId;
|
||||||
|
|
||||||
if (!tvdbIdString.IsNullOrWhiteSpace() && int.TryParse(tvdbIdString, out tvdbId))
|
if (!imdbIdString.IsNullOrWhiteSpace() && int.TryParse(imdbIdString, out imdbId))
|
||||||
{
|
{
|
||||||
return tvdbId;
|
return imdbId;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual int GetTvRageId(XElement item)
|
|
||||||
{
|
|
||||||
var tvRageIdString = TryGetNewznabAttribute(item, "rageid");
|
|
||||||
int tvRageId;
|
|
||||||
|
|
||||||
if (!tvRageIdString.IsNullOrWhiteSpace() && int.TryParse(tvRageIdString, out tvRageId))
|
|
||||||
{
|
|
||||||
return tvRageId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class ReleaseInfo
|
||||||
public DownloadProtocol DownloadProtocol { get; set; }
|
public DownloadProtocol DownloadProtocol { get; set; }
|
||||||
public int TvdbId { get; set; }
|
public int TvdbId { get; set; }
|
||||||
public int TvRageId { get; set; }
|
public int TvRageId { get; set; }
|
||||||
|
public int ImdbId { get; set; }
|
||||||
public DateTime PublishDate { get; set; }
|
public DateTime PublishDate { get; set; }
|
||||||
|
|
||||||
public string Origin { get; set; }
|
public string Origin { get; set; }
|
||||||
|
@ -82,6 +83,7 @@ public virtual string ToString(string format)
|
||||||
stringBuilder.AppendLine("DownloadProtocol: " + DownloadProtocol ?? "Empty");
|
stringBuilder.AppendLine("DownloadProtocol: " + DownloadProtocol ?? "Empty");
|
||||||
stringBuilder.AppendLine("TvdbId: " + TvdbId ?? "Empty");
|
stringBuilder.AppendLine("TvdbId: " + TvdbId ?? "Empty");
|
||||||
stringBuilder.AppendLine("TvRageId: " + TvRageId ?? "Empty");
|
stringBuilder.AppendLine("TvRageId: " + TvRageId ?? "Empty");
|
||||||
|
stringBuilder.AppendLine("ImdbId: " + ImdbId ?? "Empty");
|
||||||
stringBuilder.AppendLine("PublishDate: " + PublishDate ?? "Empty");
|
stringBuilder.AppendLine("PublishDate: " + PublishDate ?? "Empty");
|
||||||
return stringBuilder.ToString();
|
return stringBuilder.ToString();
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue