Skip to content

Commit

Permalink
Merge pull request #71 from mtrogman/renameAppCmds
Browse files Browse the repository at this point in the history
Rename app cmds
  • Loading branch information
mtrogman authored Jul 28, 2024
2 parents 53fd646 + b5dec96 commit b32a852
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.0
1.7.0
2 changes: 2 additions & 0 deletions config.yml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
bot:
token: PUT_DISCORD_BOT_TOKEN_HERE
regrab_movie: PUT_NAME_OF_REGRAB_MOVIE_APP_CONFIG_HERE
regrab_episode: PUT_NAME_OF_REGRAB_EPISODE_APP_CONFIG_HERE

sonarr:
api_key: PUT_SONARR_API_KEY_HERE
Expand Down
8 changes: 5 additions & 3 deletions regrabarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def get_config(file):
sonarr_api_key = config['sonarr']['api_key']
sonarr_base_url = config['sonarr']['url'].rstrip('/')

regrab_movie_command_name = config['bot'].get('regrab_movie', 'regrab_movie')
regrab_episode_command_name = config['bot'].get('regrab_episode', 'regrab_episode')

# Requests Session
session = requests.Session()

Expand Down Expand Up @@ -390,7 +393,6 @@ async def fetch_episodes(media_info):
return []



async def fetch_episode_details(episode_results, media_info):
episode_details = episode_results[media_info['episodeArrayNumber']]
media_info['title'] = episode_details['title']
Expand All @@ -414,7 +416,7 @@ async def on_ready():
logging.error(f"{e}")


@bot.tree.command(name="regrab_movie", description="Will delete and redownload selected movie")
@bot.tree.command(name=regrab_movie_command_name, description="Will delete and redownload selected movie")
@app_commands.describe(movie="What movie should we regrab?")
async def regrab_movie(ctx, *, movie: str):
movie_results = await fetch_movie(movie)
Expand All @@ -427,7 +429,7 @@ async def regrab_movie(ctx, *, movie: str):
await ctx.response.send_message("Select a movie to regrab", view=MovieSelectorView(movie_results, media_info), ephemeral=True)


@bot.tree.command(name="regrab_episode", description="Will delete and redownload selected episode")
@bot.tree.command(name=regrab_episode_command_name, description="Will delete and redownload selected episode")
@app_commands.describe(series="What TV series should we regrab from?")
async def regrab_episode(ctx, *, series: str):
series_results = await fetch_series(series)
Expand Down

0 comments on commit b32a852

Please sign in to comment.