'Get episodes by show ID'

@etag
@api.response(200, u'Episodes    retrieved    successfully    for    show', episode_list_schema)
@api.doc(description=u'Get    all    show    episodes    via    its    ID', parser=episode_parser)
def get(self, show_id, session):

    args = episode_parser.parse_args()
    page = args[u'page']
    per_page = args[u'per_page']
    sort_order = args[u'order']
    if (per_page > 100):
        per_page = 100
    descending = (sort_order == u'desc')
    start = (per_page * (page - 1))
    stop = (start + per_page)
    kwargs = {u'start': start, u'stop': stop, u'descending': descending, u'session': session}
    try:
        show = series.show_by_id(show_id, session=session)
    except NoResultFound:
        raise NotFoundError((u'show    with    ID    %s    not    found' % show_id))
    total_items = series.show_episodes(show, count=True, session=session)
    if (not total_items):
        return jsonify([])
    episodes = [episode.to_dict() for episode in series.show_episodes(show, **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(episodes))
    pagination = pagination_headers(total_pages, total_items, actual_size, request)
    rsp = jsonify(episodes)
    rsp.headers.extend(pagination)
    rsp.headers.extend({u'Series-ID': show_id})
    return rsp
