def get_movie(id: int, repo: AbstractRepository): movie = repo.get_movie(id) if movie is None: raise NoneException return movie_to_dict(movie)
def get_director(repo: AbstractRepository): director = repo.get_directors() directors = [d.director_full_name for d in director] return directors
def get_genres(repo: AbstractRepository): genres = repo.get_genres() genre_names = [genre.genre_name for genre in genres] return genre_names
def get_actors(repo: AbstractRepository): actors = repo.get_actors() actors_list = [actor.actor_full_name for actor in actors] return actors_list
def get_movies_by_id(ids, repo: AbstractRepository): movies = repo.get_movies_by_id(ids) movies_dict = movies_to_dict(movies) return movies_dict
def get_movie_ids_director(director, repo: AbstractRepository): movie_ids = repo.get_movies_for_director(director) return movie_ids
def get_movie_ids_genre(genre, repo: AbstractRepository): movie_ids = repo.get_movies_for_genre(genre) return movie_ids
def get_movie_ids(repo: AbstractRepository): movie_ids = repo.get_movies_id_all() return movie_ids