

Since the simplest solution is often the best, I would recommend working on a way to automate the settings.xml file. Xbmc.executebuiltin('UpdateLibrary(music)') Xbmc.executebuiltin('UpdateLibrary(video)') Here's an example from the PlexKodiConnect GitHub project: # Make sure Kodi knows we wiped the databases Use the Add-On APIĪnother technique is to use the official Python API, such as through UpdateLibrary(database, path) however examples usually involve Python to call the API directly. There may be some "watchdog" add-ons that can do this for you. however comments suggest Kodi needs to be restarted and that this location still needs to be crawled/refreshed.

I dove into this and the XML seems like the way to go, for example, to add Videos:
#Kodi add music source linein how to#
The official wiki mentions /userdata/sources.xml for this but it still assumes you know how to manipulate an XML file programmatically and the community warns that this is potentially "invasive" and that the official addons/plugins aren't allowed to use this technique. Kodi stores this information in a sqlite database, however this location would be pretty tricky to manipulate yourself as it would require both knowledge of the path of each sqlite database file as well as the relationship of each column/table in each database file (assuming it's a strictly relational database file, which most are).įor example: sqlite3 /userdata/Database/MyVideos119.db

Rename the media source, if needed, and select OK. If your files are located on a network attached storage, you will need to add the SMB or NFS share from the NAS server. Browse to the folder where your media files are stored. Edit the Database Directly (not recommended) Select Add Videos and Browse in the add video source. Crawling the Kodi/XBMC forums and wiki show a few options.
