AnthonyMusgrove / Emby-ScripterX

Run custom external application or script (batch/bash/powershell/php/python/node.js/custom) on various events within the Emby Server.
https://emby-scripterx.com
76 stars 6 forks source link

action request: onUserModifyFavorite #74

Open solajim opened 11 months ago

solajim commented 11 months ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like A new action that is triggered when a user favorites or unfavorites something. I'd like to use the action to execute some API calls to determine if the favorited item is in my library already, and if not, then do some magic to get it added. This would mainly be used in the Trailers plugin.

Describe alternatives you've considered The other solution is to spin up a webhook endpoint with Node.js or maybe Flask that works via localhost, but that has two drawbacks: 1 - it requires running a servlet 2 - it wouldn't be able to be packaged within Scripter-X for others to use

As a workaround, I'll probably end up guiding users to add things they want to a list called "wishlist" (playlist updates trigger onMediaItemUpdated), but it's not as clean of a solution as just hitting the favorite button

solajim commented 11 months ago

finally managed to get a payload from the onMediaItemUpdated - it doesn't actually tell you the item that was added to the playlist. so, not really a workaround.