2023-08-18, 14:23
(2023-08-18, 14:17)jbinkley60 Wrote:(2023-08-18, 13:20)TwilightMercy Wrote: The code indeed works and runs at Kodi launch. but then the code runs again when I launch the addon inside Kodi.
I want to run the code only once for Kodi startup only.
Is it possible?
Yes, you'll need to catch sys.argv[2] in your kodi_startup.py file and if it is "clean_folders" then don't execute. Another way to do it is in your service since it only runs once. I do this here in my sevice.py file. These three functions only get called once when the service starts.
Jeff
The thing is the code I wrote in kodi_startup.py does run when kodi starts (because service addon starts).
But later when I launch the addon later inside Kodi (searching for subtitles), the kodi_startup.py runs again and runs the code.
I want it to run only on Kodi startup once