'Add movies to list by ID'

@api.validate(model=input_movie_entry_schema, description=movie_identifiers_doc)
@api.response(201, model=movie_list_object_schema)
@api.response(NotFoundError)
@api.response(Conflict)
@api.response(BadRequest)
def post(self, list_id, session=None):

    try:
        ml.get_list_by_id(list_id=list_id, session=session)
    except NoResultFound:
        raise NotFoundError((u'list_id    %d    does    not    exist' % list_id))
    data = request.json
    movie_identifiers = data.get(u'movie_identifiers', [])
    for id_name in movie_identifiers:
        if (list(id_name)[0] not in MovieListBase().supported_ids):
            raise BadRequest((u'movie    identifier    %s    is    not    allowed' % id_name))
    (title, year) = (data[u'movie_name'], data.get(u'movie_year'))
    movie = ml.get_movie_by_title_and_year(list_id=list_id, title=title, year=year, session=session)
    if movie:
        raise Conflict((u'movie    with    name    "%s"    already    exist    in    list    %d' % (title, list_id)))
    movie = ml.MovieListMovie()
    movie.title = title
    movie.year = year
    movie.ids = ml.get_db_movie_identifiers(identifier_list=movie_identifiers, session=session)
    movie.list_id = list_id
    session.add(movie)
    session.commit()
    response = jsonify(movie.to_dict())
    response.status_code = 201
    return response
