Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structures for AlertListener messages #1388

Open
glensc opened this issue Mar 26, 2024 · 0 comments
Open

Structures for AlertListener messages #1388

glensc opened this issue Mar 26, 2024 · 0 comments

Comments

@glensc
Copy link
Contributor

glensc commented Mar 26, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant