Exemple #1
0
def get_movie(id: int, repo: AbstractRepository):
    movie = repo.get_movie(id)

    if movie is None:
        raise NoneException

    return movie_to_dict(movie)
Exemple #2
0
def get_director(repo: AbstractRepository):
    director = repo.get_directors()
    directors = [d.director_full_name for d in director]

    return directors
Exemple #3
0
def get_genres(repo: AbstractRepository):
    genres = repo.get_genres()
    genre_names = [genre.genre_name for genre in genres]

    return genre_names
Exemple #4
0
def get_actors(repo: AbstractRepository):
    actors = repo.get_actors()
    actors_list = [actor.actor_full_name for actor in actors]

    return actors_list
Exemple #5
0
def get_movies_by_id(ids, repo: AbstractRepository):
    movies = repo.get_movies_by_id(ids)
    movies_dict = movies_to_dict(movies)
    return movies_dict
Exemple #6
0
def get_movie_ids_director(director, repo: AbstractRepository):
    movie_ids = repo.get_movies_for_director(director)
    return movie_ids
Exemple #7
0
def get_movie_ids_genre(genre, repo: AbstractRepository):
    movie_ids = repo.get_movies_for_genre(genre)
    return movie_ids
Exemple #8
0
def get_movie_ids(repo: AbstractRepository):
    movie_ids = repo.get_movies_id_all()
    return movie_ids