Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Add ability to receive a webhook to trigger refresh of a specified collection #65

Closed
doctarrwho opened this issue Feb 25, 2021 · 4 comments · Fixed by #76
Assignees
Labels
enhancement New feature or request

Comments

@doctarrwho
Copy link

For the "Trending" collection, I have add_to_arr set to true, which is great - except I have the script scheduled to run at 9pm local time and by the time the next run occurs (next day at 9pm), the movie that was added to arr and later imported in plex is no longer trending...

It would be awesome if I could configure a webhook in radarr to trigger PMM to initiate a collection update for the "Trending" collection after a movie is Imported.

@meisnate12
Copy link
Member

tbh im not sure how to set up something in python that radarr could hit with a webhook. I'll look into that but depending on what it would take to do that I don't know if I would.

What I know I could do is create a way to run specific collections again after a user-defined delay, possibly even multiple times with different delays.

Well, now that I think about it there's also the problem that for some people it takes hours for it to run I think my average run time is 4-5 hours. Maybe I could add a feature where you can automatically run collections again at the end of your run so like you have Trending run first and add movies to radarr and then give it a run_again: true option and then it would run again at the end hours later hopefully now adding your movies to radarr.

But the trending list might change by then anyway, so a third option is to have the program remember the exact TMDb IDs that it sent to radarr for each collection and have it try and find those and add them to the collection either at the end of your run or after a delay.

What do you think?

@meisnate12 meisnate12 added the enhancement New feature or request label Feb 25, 2021
@meisnate12 meisnate12 self-assigned this Feb 25, 2021
@doctarrwho
Copy link
Author

There's some good info here about webhooks with python: https://blog.bearer.sh/consume-webhooks-with-python/

Yes, it's not an easy problem to solve and keep everyone happy. I did think about trending list changing on each run, and was going to suggest having an option in webhook to override add_to_arr to avoid repeated collection updates, BUT I didn't want to make this request too convoluted :)

Having said that, run_again: true option for a collection does work - My average run time is around 30 mins, so that's plenty of time for arr to download a trending item. This is probably going to be easier to implement, but someone like you with an average run time of 4-5 hours might want it on a specified delay instead of at the end of the run.

For me, either of these options would work so I'd be happy with you adding whatever is the easiest for you.

Also, worst case scenario, the ability to override add_to_arr via a command line parameter would help, because then I could just run a script on a schedule that docker exec's and updates the trending collection every couple of hours or so but I would only want trending items added to arr on the full run at 9pm.

@meisnate12
Copy link
Member

for real thinking on this any way you rerun the collection even 10 minutes after you run it the first time the trending list will change. so I think the best option is to have it save what movies were added. I've got an idea of how to do this I'll try and get it in the next release

meisnate12 added a commit that referenced this issue Mar 1, 2021
@meisnate12
Copy link
Member

you can add run_again: true to a collection to have it try and add the missing items to the collection after the daily run.

If you want to add a time delay after the daily run under the settings attribute in your config file you can have the run_again_delay attribute which takes a number of minutes after the daily run to run the collections again and it defaults to zero.

@meisnate12 meisnate12 mentioned this issue Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants