Exemple #1
0
        private List <BlacklistResource> GetMovieBlacklist()
        {
            var queryMovieId = Request.Query.MovieId;

            if (!queryMovieId.HasValue)
            {
                throw new BadRequestException("movieId is missing");
            }

            int movieId = Convert.ToInt32(queryMovieId.Value);

            return(_blacklistService.GetByMovieId(movieId).Select(h => BlacklistResourceMapper.MapToResource(h, _formatCalculator)).ToList());
        }
Exemple #2
0
        private PagingResource <BlacklistResource> GetBlacklist(PagingResource <BlacklistResource> pagingResource)
        {
            var pagingSpec = pagingResource.MapToPagingSpec <BlacklistResource, NzbDrone.Core.Blacklisting.Blacklist>("date", SortDirection.Descending);

            return(ApplyToPage(_blacklistService.Paged, pagingSpec, (blacklist) => BlacklistResourceMapper.MapToResource(blacklist, _formatCalculator)));
        }