1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 18:42:42 +01:00

Fix ordering in PTP, should prefer GP releases (#667)

* Fix ordering in PTP, should prefer GP releases

* Apply more checks
This commit is contained in:
Devin Buhl 2017-02-08 14:26:11 -05:00 committed by GitHub
parent 0941247f63
commit f577590ad6

View File

@ -56,14 +56,6 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
title = $"{title} ✔";
}
//if (IsPropertyExist(torrent, "RemasterTitle"))
//{
// if (torrent.RemasterTitle != null)
// {
// title = $"{title} - {torrent.RemasterTitle}";
// }
//}
// Only add approved torrents
if (_settings.Approved && torrent.Checked)
{
@ -109,9 +101,37 @@ public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
}
// prefer golden
if (_settings.Golden)
{
if (_settings.Scene)
{
return
torrentInfos.OrderByDescending(o => o.PublishDate)
.ThenBy(o => ((dynamic)o).Golden ? 0 : 1)
.ThenBy(o => ((dynamic) o).Scene ? 0 : 1)
.ToArray();
}
return
torrentInfos.OrderByDescending(o => o.PublishDate)
.ThenBy(o => ((dynamic)o).Golden ? 0 : 1)
.ToArray();
}
// prefer scene
// require approval
return torrentInfos.OrderBy(o => ((dynamic)o).Golden ? 0 : 1).ThenBy(o => ((dynamic)o).Scene ? 0 : 1).ThenByDescending(o => ((dynamic)o).PublishDate).ToArray();
if (_settings.Scene)
{
return
torrentInfos.OrderByDescending(o => o.PublishDate)
.ThenBy(o => ((dynamic)o).Scene ? 0 : 1)
.ToArray();
}
// order by date
return
torrentInfos
.OrderByDescending(o => o.PublishDate)
.ToArray();
}
private string GetDownloadUrl(int torrentId, string authKey, string passKey)