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)
def check_if_added(movie_rank: int, repo: AbstractRepository): add = repo.check_if_added(movie_rank) return add