ynput / ayon-kitsu

Official AYON<->Kitsu intetgration (WIP)
Apache License 2.0
8 stars 5 forks source link

Add leecher service (gazu event listener) #25

Closed EmberLightVFX closed 7 months ago

EmberLightVFX commented 8 months ago

This PR adds a leecher service like the Shotgrid addon have. With this leecher we can now interact with Gazy events. The processor service has bin updated to take the leecher event and do the processing.

The processor still have the old full_sync code and handler, so it's currently checking for two different events (The leecher event and full_sync event). As the full_sync code is quite extensive I felt that cleaning up that part of the code might be on another PR.

I'll start this PR as a draft so we can start a conversation on how we want the functions to work.

Current state: Leecher:

Processor (Kitsu -> Ayon):

EmberLightVFX commented 8 months ago

Decided to re-write some code and it now works using the Kitsu-ID for everything :) Meaning we can rename what ever to what ever and the syncing will still work! 🥳

EmberLightVFX commented 8 months ago

For anyone who might want to try the code out, this is the vscode task I'm using to launch both the leecher and the processor at the same time (for windows only):

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run Processor Service",
            "type": "shell",
            "command": "",
            "args": [
                "${workspaceFolder}/.venv/Scripts/Activate.ps1;",
                "cd",
                "${workspaceFolder}/ayon-kitsu/services/;",
                "make",
                "SERVICE=processor",
                "run"
            ],
            "presentation": {
                "group": "kitsu_leecher"
            },
            "problemMatcher": []
        },
        {
            "label": "Run Leecher Service",
            "type": "shell",
            "command": "",
            "args": [
                "${workspaceFolder}/.venv/Scripts/Activate.ps1;",
                "cd",
                "${workspaceFolder}/ayon-kitsu/services/;",
                "make",
                "SERVICE=leecher",
                "run"
            ],
            "presentation": {
                "group": "kitsu_leecher"
            }
        },
        {
            "label": "Run Both Services",
            "dependsOn": [
                "Run Leecher Service",
                "Run Processor Service"
            ],
            "command": "echo",
            "args": [
                "Both services completed"
            ],
            "problemMatcher": []
        }
    ]
}