Open devfake opened 4 years ago
I believe this would require a plugin to be installed on the Jellyfin server for it to make calls to your API. Otherwise you need to constantly query the API, which is annoying.
See here for a webhook plugin that might work.
If someone writes up a nice template for that plugin to interact with your Plex API you probably don't need to do any work on this codebase. At least I think that's what this plugin is capable of with that PlayedToCompletion
hook...
I maked this template. Works fine.
{"payload": "{\"Metadata\": {\"type\": {{#if_equals ItemType 'Episode'}}\"episode\"{{else}}{{#if_equals ItemType 'Movie'}}\"movie\"{{else}}\"{{ItemType}}\"{{/if_equals}}{{/if_equals}}, \"parentIndex\": \"{{SeasonNumber}}\", \"index\": \"{{EpisodeNumber}}\", \"grandparentTitle\": \"{{{SeriesName}}}\", \"title\": \"{{{Name}}}\", \"year\": \"{{Year}}\", \"tmdb_id\": \"{{Provider_tmdb}}\", \"imdb_id\": \"{{Provider_imdb}}\"}, \"event\": {{#if_equals NotificationType 'PlaybackStart'}}\"media.play\"{{/if_equals}}{{#if_equals NotificationType 'PlaybackStop'}}{{#if_equals PlayedToCompletion true}}\"media.scrobble\"{{else}}\"media.stop\"{{/if_equals}}{{/if_equals}} }"}
And headers:
I taken this data from Plex request.
I am looking for someone who could build a simple Jellyfin API for Flox.
There is already one for Plex (https://github.com/devfake/flox/issues/127). However, I don't think there is any simple webhook functionality built in for Jellyfin?
The required data for Flox are very simple. The class must inherit from the abstract api class and implement the necessary methods. Example from Plex: https://github.com/devfake/flox/blob/master/backend/app/Services/Api/Plex.php.
Or is it necessary to request the API of Jellyfin itself? For example via a cronjob.