'TVMaze series lookup'

@etag
@api.response(200, u'Successfully    found    show', model=tvmaze_series_schema)
@api.response(NotFoundError)
def get(self, title, session=None):

    try:
        tvmaze_id = int(title)
    except ValueError:
        tvmaze_id = None
    try:
        if tvmaze_id:
            series = tvm.series_lookup(tvmaze_id=tvmaze_id, session=session)
        else:
            series = tvm.series_lookup(series_name=title, session=session)
    except LookupError as e:
        raise NotFoundError(e.args[0])
    return jsonify(series.to_dict())
