Polling Kodi for Running Processes

  • I have finally been able to control Kodi from remote on my home LAN using Python scripts on WSL2, and when I do a VideoLibrary.Scan, I do get the expected "OK" back via JSON, but is there a way to poll Kodi or look at processes to see when that scan is completed?

    I am using this method, and VideoLibrary.Clean from a VB.NET Windows Forms application to interact with the Kodi database (ready only) to search for specific media assets, etc. When I make changes to my NAS resources as a result of this app, I want to periodically (on-demand) clean, then update Kodi's database, then pull it locally to update what my app sees. But I do not want to pull it's user database until the scan is complete. I am pulling the database locally because it is faster for my app to access and I wanted that barrier in case I somehow change the database, and I do not want to corrupt it on my LibreElec install of Kodi. I would rather let Kodi make the database updates based on what it sees on my multiple NAS resources.

    I apologize if this has been asked before. I did extensive google searches and a few forums and did not get any hits.

    Thanks for your time!

  • I don't think it's possible (without extending Kodi to track tasks and generate responses on status requests) but the better/best place to ask the Q is the Kodi forum where Kodi devs might have other ideas; it's not something specific to LibreELEC.

  • I got my answer in a big way on the Kodi forums. Thank you sir for the suggestion!!

    I have done a number of Kodi installs in various environments, but this latest try using LibreElec on a Raspberry Pi 4 8gb has been the most rewarding. Now with my ability to shell into the client, pull the user database, send commands using sockets, and being able to explore all that both OS and Kodi have to offer, I FINALLY have the media client setup of my dreams become a reality. And because of this, my nVidia Shield is going to be collecting a whole lot of dust moving forward. lol

    Thanks again!