'Get all episodes releases by show ID and episode ID'

@etag
@api.response(200, u'Releases    retrieved    successfully    for    episode', release_list_schema)
@api.doc(description=u'Get    all    matching    releases    for    a    specific    episode    of    a    specific    show.', parser=release_list_parser)
def get(self, show_id, ep_id, session):

    try:
        series.show_by_id(show_id, session=session)
    except NoResultFound:
        raise NotFoundError((u'show    with    ID    %s    not    found' % show_id))
    try:
        episode = series.episode_by_id(ep_id, session)
    except NoResultFound:
        raise NotFoundError((u'episode    with    ID    %s    not    found' % ep_id))
    if (not series.episode_in_show(show_id, ep_id)):
        raise BadRequest((u'episode    with    id    %s    does    not    belong    to    show    %s' % (ep_id, show_id)))
    args = release_list_parser.parse_args()
    downloaded = args.get(u'downloaded')
    page = args[u'page']
    per_page = args[u'per_page']
    sort_by = args[u'sort_by']
    sort_order = args[u'order']
    descending = (sort_order == u'desc')
    if (per_page > 100):
        per_page = 100
    start = (per_page * (page - 1))
    stop = (start + per_page)
    kwargs = {u'downloaded': downloaded, u'start': start, u'stop': stop, u'sort_by': sort_by, u'descending': descending, u'episode': episode, u'session': session}
    total_items = series.get_releases(count=True, **kwargs)
    release_items = [release.to_dict() for release in series.get_releases(**kwargs)]
    total_pages = int(ceil((total_items / float(per_page))))
    if ((total_pages < page) and (total_pages != 0)):
        raise NotFoundError((u'page    %s    does    not    exist' % page))
    actual_size = min(per_page, len(release_items))
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    rsp = jsonify(release_items)
    rsp.headers.extend(pagination)
    rsp.headers.extend({u'Series-ID': show_id, u'Episode-ID': ep_id})
    return rsp
