KODIdb
Occasionally it is useful to rename a batch of files in the file repository. This creates the need to update the names of those files in the KODI database. There are two ways to do this.
One, the files are renamed in the repository. At this point, KODI cannot locate the old files and generates a warning dialog when a video is selected. An update of the database will detect and insert the newly named files as new additions to the database. A 'cleaning' of the database will eliminate the old file entries. This method has the unfortunate side-effect of losing all metadata attached to the original file entries, such as played status, date of entry in the database, etc.
Two, after the files are renamed in the repository, the database records of each of those files can be updated with the new filename. This method preserves the video's metatdata which is a good thing. Here are the steps:
- Connect to the file repository server
$ mysql -umpkodi -psummer98 kodiVideo99
- In the case of a group of files, i.e., when updateing a whole tv series, update en-masse:
mysql> UPDATE files SET strFilename=REPLACE(strFilename,'OTA','PDTV.OTA') WHERE strFilename LIKE '%<series name>%' AND strFilename REGEXP 'OTA' AND strFilename NOT REGEXP '.DTV';