Kodi Community Forum

Full Version: Reloading favourites.xml
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a built-in function or trick way in Python to make Kodi reload the favourites.xml file?
i want to write an add-on that changes my entries in that file, and I want to go and to view the updated favourites on screen without having to quit Kodi and restart it.
Oh, I think it you do a execute builtin with the LoadProfile command, even if it's the Master user profile (default), Kodi internally reloads the profile's favourites.
https://github.com/xbmc/xbmc/blob/master...r.cpp#L416

So maybe that's an indirect way to reload favourites.xml from Python.
(2018-06-05, 09:54)doko-desuka Wrote: [ -> ]Oh, I think it you do a execute builtin with the LoadProfile command, even if it's the Master user profile (default), Kodi internally reloads the profile's favourites.
https://github.com/xbmc/xbmc/blob/master...r.cpp#L416

So maybe that's an indirect way to reload favourites.xml from Python.
That's the only way I've found to do it.  Up until krypton you could edit favourites.xml and changes would be reflected in the gui.  That also meant you could use pathsubs and share your favourites.xml between installs.  Now it's been 'improved' the link between the .xml and what you see on-screen is gone.
@trogggy yeah it works okay, it does a bunch of stuff and sends you back to the home screen, but at least it reloads the favourites file.
If I hadn't found 'LoadProfile' by myself you would've pointed me to it, so thanks!

I needed it for an add-on for reorganising Kodi favourites. Check it out:
https://github.com/dokoab/plugin.program...default.py