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
1 changed files with 30 additions and 10 deletions

View File

@ -56,14 +56,6 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
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 @@ namespace NzbDrone.Core.Indexers.PassThePopcorn
}
// 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)