-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Labels
Description
What is your feature request?
AlertListener events are json payloads with such structure:
{'type': 'activity', 'size': 1, 'ActivityNotification': [{'event': 'ended', 'uuid': '12204475-ab69-4d49-80c4-ea87c808d1b7', 'Activity': {'uuid': '12204475-ab69-4d49-80c4-ea87c808d1b7', 'type': 'library.refresh.items', 'cancellable': False, 'userID': 1, 'title': 'Refreshing', 'subtitle': 'Refreshing media analysis', 'progress': 100, 'Context': {'accessible': True, 'analyzed': False, 'exists': True, 'key': '/library/metadata/22466', 'refreshed': False}}}]}Would be nice to have utility classes that parse size and yield structures based on type.
Additionally add some dispatcher logic to be able to handle events based on payload.
Are there any workarounds?
No response
Code Snippets
For the "message to class" logic I've implemented in my project:
This contains message classes:
and this contains dispatcher:
Additional Context
The reason I ask this, is that I have another project where want to filter and AlertListener messages...
What part of this could be in plexapi, what part is too specific not to be included? what would the structure and naming be? (I'm willing to make a PR if that's clear)