Shraymonks / unmonitorr

Unmonitor media in Radarr and Sonarr from Plex webhook events
https://hub.docker.com/r/shraymonks/unmonitorr
ISC License
26 stars 0 forks source link

Multiple Radarr insrances will unmonitorr all instances when just one user watches #6

Closed codedesperate closed 1 year ago

codedesperate commented 1 year ago

Hi there, I have two Radarr instances. One for me, and one for my dad. I have two unmonitorr containers set up for us both. And two plex webhook instances for each unmonitorr container.

However, when my dad watches something, plex then sends the webhook to both unmonitorr containers, which unmonitors the movie in both Radarr instances. When it should only unmonitorr it for my dad.

Plex webhooks has no filtration functionality, so I guess this would be a feature request :D I would love to be able to set an additional requirement on an unmonitorr container. Something like: "ACCOUNT_ID: 1", so that it only unmonitors if the account_id is the required which is provided by the Plex webhook payload.

Shraymonks commented 1 year ago

Hey @mikkelzzz3!

Just pushed 3d9938d78702a04e0448e5d12c5e93827ad604f7 to support this and it's available on docker hub if you re-pull latest. There's a new PLEX_ACCOUNTS variable that you can use to filter on Plex account id or username. Should account for your use case!

codedesperate commented 1 year ago

@Shraymonks Amazing, thank you so much! Tested & Works! Now also when I test media from admin account, it also won't unmonitor which was a bit bothersome. I'm using just the username of the plex accounts. Both an external account name, and a plex home user account name.

Shraymonks commented 1 year ago

Can you double check that the admin username being used is correct? If you trigger an event and look in the plex logs (filter with "Webhook") you should see the exact username that triggers the event.

codedesperate commented 1 year ago

Oh sorry, I didn't formulate myself properly.

I meant, before this update when I watched something from the Plex Home admin account it would unmonitor, which was bothersome because I was just testing stuff.

Now after the update, because I on purpose have not put the username of the admin account, this no longer happens :D

Thank you for the tip about the plex webhook logs. Completely forgot about that. I was testing the payload by using "netcat -l 9999" (And setting up a webhook for port 9999), and then view the json with jq. Plex logs sounds easier :D

Shraymonks commented 1 year ago

Glad it all works now 😄

The Plex logs are useful but they were actually misleading when I was testing out this feature haha. It logs the admin account ID as 1 even though the account ID used for the webhook is the real account ID.