public List <RetagBookFilePreview> GetRetagPreviewsByBook(int bookId) { var previews = _audioTagService.GetRetagPreviewsByBook(bookId); previews.AddRange(_eBookTagService.GetRetagPreviewsByBook(bookId)); return(previews); }
public List <RetagBookResource> GetBooks(int?authorId, int?bookId) { if (bookId.HasValue) { return(_audioTagService.GetRetagPreviewsByBook(bookId.Value).Where(x => x.Changes.Any()).ToResource()); } else if (authorId.HasValue) { return(_audioTagService.GetRetagPreviewsByAuthor(authorId.Value).Where(x => x.Changes.Any()).ToResource()); } else { throw new BadRequestException("One of authorId or bookId must be specified"); } }
private List<RetagBookResource> GetBooks() { if (Request.Query.bookId.HasValue) { var bookId = (int)Request.Query.bookId; return _audioTagService.GetRetagPreviewsByBook(bookId).Where(x => x.Changes.Any()).ToResource(); } else if (Request.Query.AuthorId.HasValue) { var authorId = (int)Request.Query.AuthorId; return _audioTagService.GetRetagPreviewsByAuthor(authorId).Where(x => x.Changes.Any()).ToResource(); } else { throw new BadRequestException("One of authorId or bookId must be specified"); } }