Kodi Community Forum

Full Version: Bluk Rename Mysql Paths of Muisc and Video Table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

does anyone know how to do a bulk rename of the mysql paths (movies & music) because i want to relocate the files without losing the watched,... status.
How do i change the strHash in the movie.path and music.path tables?
What are the hashes for? Are the hashes used for the thumbs also?

Maybe someone could point me in the right direction.

thx, vts
You just update them with an sql statement I assume. I haven't done it so you should of course make a backup before testing.
I think the hash is to determine if anything have changed but I am not sure.

I havent check the complete database but at least the path have to be changed
Something along these lines

update path
set StrPath = "new prefix" + strPath
But if you export the library and then enable import watch status you do not have to do it
virusthesyrus Wrote:Hi,

does anyone know how to do a bulk rename of the mysql paths (movies & music) because i want to relocate the files without losing the watched,... status.
How do i change the strHash in the movie.path and music.path tables?
What are the hashes for? Are the hashes used for the thumbs also?

Maybe someone could point me in the right direction.

thx, vts

I've only done Movies/TV but there are a few steps.

1. In path table update path set strPath to newPath where strPath = old path.
2. You do not need to change the strHash field...it's used to tell if anything
has changed so XBMC can rescan.
3. Next all the thumbnails have to be renamed and moved. The name is
derived by calculating the crc32 value of the full episode path. Let's say
your old video file is C:\Movies\StarTrek IV\StarTrekIV.avi. The hash might
be a839b26c. In the userdata thumbnails/video folder are subfolders named A-H and 0-9 which correlate to the first digit of the hash so the Thumbnail would be in the A folder and be named a839b26c.tbn. The new path might be the same except the drive letter is D: which might make the new hash 83b5292a so you would have to rename the old hash a839b26c.tbn to 83b4292a.tbn and place it in the folder named 8. Simple...right? TV Series works in a similar fashion except the string season and # are hard coded.