ynput / ayon-aquarium

AYON addon for Aquarium integration
https://ayon.ynput.io/features?addons=aquarium
Apache License 2.0
0 stars 1 forks source link

Check if event is part of a synced project before sending it to the processor #7

Closed ymoriaud closed 3 months ago

ymoriaud commented 3 months ago

The leecher is receiving all events that happen on Aquarium. Some of them might not be inside a synced project.

To avoid unnecessary event to process, we can check if the event is part of a synced project by using the event.get_context() un the callback function:

https://github.com/ynput/ayon-aquarium/blob/ea0e891187e601675408219b7ae54157701666b3/services/leecher/leecher/leecher.py#L31-L50

Here is a not tested example:

context = event.get_context()
project = context["project"]
if project is not None and project.data.ayonProjectName is not None:
    # Process the event
tweak-wtf commented 3 months ago

this is implemented as part of https://github.com/ynput/ayon-aquarium/pull/8

ymoriaud commented 3 months ago

Closed by #8