diff options
author | Parker <contact@pkrm.dev> | 2024-05-19 18:59:04 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2024-05-19 18:59:04 -0500 |
commit | 4146a188f560ce47a2e6fef4e10f2fd368d99463 (patch) | |
tree | da558d106bd764aeeb2880262fc8723d011d0472 /code/cogs/request.py | |
parent | b68c31c7e8525bd0cc8f93fb42ff176bcfcdba05 (diff) |
Fix option value already exists errors
An error would occur if two movies with the same name and year were returned. This has been fixed, and the TMDB ID is also added to the dropdown description.
Diffstat (limited to 'code/cogs/request.py')
-rw-r--r-- | code/cogs/request.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/code/cogs/request.py b/code/cogs/request.py index efd6c9d..fb1706c 100644 --- a/code/cogs/request.py +++ b/code/cogs/request.py @@ -13,8 +13,8 @@ class Request(commands.GroupCog, name="request"): @app_commands.describe(name="Name of the movie to add") async def request_movie(self, interaction: discord.Interaction, name: str): "Request a movie to be added to the Radarr library" - get_movies_response = get_movies(name) - if get_movies_response == "NO RESULTS": + movie_data = get_movies(name) + if movie_data == "NO RESULTS": embed = discord.Embed( title="No Results", description="No results were found for the given movie name. If you are unable to find the movie, contact an administrator to have it added manually.", @@ -22,7 +22,7 @@ class Request(commands.GroupCog, name="request"): ) return await interaction.response.send_message(embed=embed, ephemeral=True) - if get_movies_response == "ALREADY ADDED": + if movie_data == "ALREADY ADDED": embed = discord.Embed( title="Already Added", description="The movie you are trying to add has already been added to the Radarr library.\n\nYou can check the download status of your requests movies by running the `/status` command.", @@ -30,14 +30,12 @@ class Request(commands.GroupCog, name="request"): ) return await interaction.response.send_message(embed=embed, ephemeral=True) - movies, tmdb_ids = get_movies_response - embed = discord.Embed( title="Results Found", description="Please select the movie you would like to add from the dropdown below.", color=0xD01B86 ) - view = AddMovieView(movies, tmdb_ids) + view = AddMovieView(movie_data) await interaction.response.send_message(embed=embed, view=view, ephemeral=True) @app_commands.command(name="show") |