示例#1
0
def add_to_watchlist(movie_rank: int, repo: AbstractRepository):
    # Check that the movie exists
    movie = repo.get_movie(movie_rank)
    if movie is None:
        raise NonExistentMovieException

    # Update the repository
    repo.add_to_watchlist(movie)

    add = repo.check_if_added(movie_rank)
示例#2
0
def check_if_added(movie_rank: int, repo: AbstractRepository):
    add = repo.check_if_added(movie_rank)

    return add