private List <RetagBookResource> GetBooks() { if (Request.Query.bookId.HasValue) { var bookId = (int)Request.Query.bookId; return(_audioTagService.GetRetagPreviewsByAlbum(bookId).Where(x => x.Changes.Any()).ToResource()); } else if (Request.Query.AuthorId.HasValue) { var authorId = (int)Request.Query.AuthorId; return(_audioTagService.GetRetagPreviewsByArtist(authorId).Where(x => x.Changes.Any()).ToResource()); } else { throw new BadRequestException("One of authorId or bookId must be specified"); } }
private List <RetagTrackResource> GetTracks() { if (Request.Query.albumId.HasValue) { var albumId = (int)Request.Query.albumId; return(_audioTagService.GetRetagPreviewsByAlbum(albumId).Where(x => x.Changes.Any()).ToResource()); } else if (Request.Query.ArtistId.HasValue) { var artistId = (int)Request.Query.ArtistId; return(_audioTagService.GetRetagPreviewsByArtist(artistId).Where(x => x.Changes.Any()).ToResource()); } else { throw new BadRequestException("One of artistId or albumId must be specified"); } }