Jump to content

WatchedTrigger to webhook plugin DEV - need help pls -


Recommended Posts

Posted (edited)

HI! First of all i don't know how to code in C+.

I could create a plugin with hardcoded USERID (with AI). It is sends a webhook when a specific user watched a movie or episodeI tried to add configuration page to UI, because i want to be able to enable/disable plugin, and to change UserID from UI. But I couldn'T get it work. 
Maybe somebody can help me, how to do it?


UI: Built in solution only tirgger when watched status is changed MANUALLY... This script works not just when  manual update happened.


Long version:
In Emby, a movie (or episode) is considered "watched" when the Played flag in the user's data becomes true. By default, Emby marks a video as watched when:

  • At least 90–95% of the video is played (depending on server settings).

  • Or if the user manually sets it as "Watched".

THe plugin is listening to this event: _userDataManager.UserDataSaved += OnUserDataSaved;

That event triggers every time Emby updates playback info, such as:

  • play progress

  • resume position

So when a movie is marked as played (Played == true), plugin sends the webhook

Here are the files:
Plugin.csWatchedTrigger.csprojWatchedTrigger.cs

Edited by shummo
update
Posted

Hi, are the built in webhooks not sufficient?

Posted

Thank for reply. No. Because built in solution only tirgger when watched status is changed MANUALLY...This script works not just when  manual update happened.

I now that this is a little too complicated, but i use / want to use Watcharr. I already create a python script which is about to start watcharrs EMBY update ( GET      "/api/jellyfin/sync"
). But it should runs after i watched a movie /episode. I do not manually do it.  (So i use my Homeassistant as a webhook server, which start the watcharrs update.) Unfortunatelly watcharr still only updateable like this. (no api).
 

  • 2 weeks later...
Posted

When you stop, the webhook data for that contains a value called PlayedToCompletion. Wouldn't that do what you want?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...