@ -1,7 +1,6 @@
using System ;
using System ;
using System.Collections.Generic ;
using System.Collections.Generic ;
using System.Linq ;
using System.Linq ;
using Nancy ;
using NzbDrone.Core.CustomFormats ;
using NzbDrone.Core.CustomFormats ;
using NzbDrone.Core.Datastore ;
using NzbDrone.Core.Datastore ;
using NzbDrone.Core.DecisionEngine.Specifications ;
using NzbDrone.Core.DecisionEngine.Specifications ;
@ -39,6 +38,7 @@ namespace Radarr.Api.V3.History
Get ( "/since" , x = > GetHistorySince ( ) ) ;
Get ( "/since" , x = > GetHistorySince ( ) ) ;
Get ( "/movie" , x = > GetMovieHistory ( ) ) ;
Get ( "/movie" , x = > GetMovieHistory ( ) ) ;
Post ( "/failed" , x = > MarkAsFailed ( ) ) ;
Post ( "/failed" , x = > MarkAsFailed ( ) ) ;
Post ( @"/failed/(?<id>[\d]{1,10})" , x = > MarkAsFailed ( ( int ) x . Id ) ) ;
}
}
protected HistoryResource MapToResource ( MovieHistory model , bool includeMovie )
protected HistoryResource MapToResource ( MovieHistory model , bool includeMovie )
@ -130,10 +130,18 @@ namespace Radarr.Api.V3.History
return _historyService . GetByMovieId ( movieId , eventType ) . Select ( h = > MapToResource ( h , includeMovie ) ) . ToList ( ) ;
return _historyService . GetByMovieId ( movieId , eventType ) . Select ( h = > MapToResource ( h , includeMovie ) ) . ToList ( ) ;
}
}
// v4 TODO: Getting the ID from the form is atypical, consider removing.
private object MarkAsFailed ( )
private object MarkAsFailed ( )
{
{
var id = ( int ) Request . Form . Id ;
var id = ( int ) Request . Form . Id ;
return MarkAsFailed ( id ) ;
}
private object MarkAsFailed ( int id )
{
_failedDownloadService . MarkAsFailed ( id ) ;
_failedDownloadService . MarkAsFailed ( id ) ;
return new object ( ) ;
return new object ( ) ;
}
}
}
}