New: Show source/seed info in manual search

This commit is contained in:
Keivan Beigi
2014-12-19 17:21:03 -08:00
parent 3d1e0e7042
commit d849a4ab48
18 changed files with 169 additions and 56 deletions

View File

@@ -54,7 +54,7 @@ namespace NzbDrone.Api.Indexers
private Response DownloadRelease(ReleaseResource release)
{
var remoteEpisode = _remoteEpisodeCache.Find(release.Guid);
if (remoteEpisode == null)
{
_logger.Debug("Couldn't find requested release in cache, cache timeout probably expired.");
@@ -142,6 +142,21 @@ namespace NzbDrone.Api.Indexers
release.QualityWeight += release.Quality.Revision.Real * 10;
release.QualityWeight += release.Quality.Revision.Version;
var torrentRelease = downloadDecision.RemoteEpisode.Release as TorrentInfo;
if (torrentRelease != null)
{
release.Protocol = DownloadProtocol.Torrent;
release.Seeders = torrentRelease.Seeders;
//TODO: move this up the chains
release.Leechers = torrentRelease.Peers - torrentRelease.Seeders;
}
else
{
release.Protocol = DownloadProtocol.Usenet;
}
result.Add(release);
}