@ -117,8 +117,6 @@ namespace NzbDrone.Core.Download.Pending
foreach ( var pendingRelease in GetPendingReleases ( ) )
foreach ( var pendingRelease in GetPendingReleases ( ) )
{
{
//foreach (var episode in pendingRelease.RemoteEpisode.Episodes)
//{
var ect = pendingRelease . Release . PublishDate . AddMinutes ( GetDelay ( pendingRelease . RemoteMovie ) ) ;
var ect = pendingRelease . Release . PublishDate . AddMinutes ( GetDelay ( pendingRelease . RemoteMovie ) ) ;
if ( ect < nextRssSync . Value )
if ( ect < nextRssSync . Value )
@ -136,7 +134,7 @@ namespace NzbDrone.Core.Download.Pending
Series = null ,
Series = null ,
Episode = null ,
Episode = null ,
Movie = pendingRelease . RemoteMovie . Movie ,
Movie = pendingRelease . RemoteMovie . Movie ,
Quality = pendingRelease . RemoteMovie . ParsedMovieInfo .Quality ,
Quality = pendingRelease . RemoteMovie . ParsedMovieInfo ? .Quality ? ? new QualityModel ( ) ,
Title = pendingRelease . Title ,
Title = pendingRelease . Title ,
Size = pendingRelease . RemoteMovie . Release . Size ,
Size = pendingRelease . RemoteMovie . Release . Size ,
Sizeleft = pendingRelease . RemoteMovie . Release . Size ,
Sizeleft = pendingRelease . RemoteMovie . Release . Size ,
@ -146,16 +144,16 @@ namespace NzbDrone.Core.Download.Pending
Status = "Pending" ,
Status = "Pending" ,
Protocol = pendingRelease . RemoteMovie . Release . DownloadProtocol
Protocol = pendingRelease . RemoteMovie . Release . DownloadProtocol
} ;
} ;
queued . Add ( queue ) ;
queued . Add ( queue ) ;
//}
}
}
//Return best quality release for each episode
//Return best quality release for each episode
var deduped = queued . GroupBy ( q = > q . Episod e. Id ) . Select ( g = >
var deduped = queued . GroupBy ( q = > q . Movi e. Id ) . Select ( g = >
{
{
var series = g . First ( ) . Series ;
var movies = g . First ( ) . Movie ;
return g . OrderByDescending ( e = > e . Quality , new QualityModelComparer ( ser ies. Profile ) )
return g . OrderByDescending ( e = > e . Quality , new QualityModelComparer ( mov ies. Profile ) )
. ThenBy ( q = > PrioritizeDownloadProtocol ( q . Movie , q . Protocol ) )
. ThenBy ( q = > PrioritizeDownloadProtocol ( q . Movie , q . Protocol ) )
. First ( ) ;
. First ( ) ;
} ) ;
} ) ;
@ -254,12 +252,12 @@ namespace NzbDrone.Core.Download.Pending
return new [ ] { delay , minimumAge } . Max ( ) ;
return new [ ] { delay , minimumAge } . Max ( ) ;
}
}
private void RemoveGrabbed ( RemoteMovie remote Episod e)
private void RemoveGrabbed ( RemoteMovie remote Movi e)
{
{
var pendingReleases = GetPendingReleases ( ) ;
var pendingReleases = GetPendingReleases ( ) ;
var existingReports = pendingReleases . Where ( r = > r . RemoteMovie . Movie . Id = = remote Episod e. Movie . Id )
var existingReports = pendingReleases . Where ( r = > r . RemoteMovie . Movie . Id = = remote Movi e. Movie . Id )
. ToList ( ) ;
. ToList ( ) ;
if ( existingReports . Empty ( ) )
if ( existingReports . Empty ( ) )
@ -267,11 +265,11 @@ namespace NzbDrone.Core.Download.Pending
return ;
return ;
}
}
var profile = remote Episod e. Movie . Profile . Value ;
var profile = remote Movi e. Movie . Profile . Value ;
foreach ( var existingReport in existingReports )
foreach ( var existingReport in existingReports )
{
{
var compare = new QualityModelComparer ( profile ) . Compare ( remote Episod e. ParsedMovieInfo . Quality ,
var compare = new QualityModelComparer ( profile ) . Compare ( remote Movi e. ParsedMovieInfo . Quality ,
existingReport . RemoteMovie . ParsedMovieInfo . Quality ) ;
existingReport . RemoteMovie . ParsedMovieInfo . Quality ) ;
//Only remove lower/equal quality pending releases
//Only remove lower/equal quality pending releases