Kodi Community Forum

Full Version: SQL queries to change TV show path
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running LibreELEC 9.0.2 and for some reason I didn't create a season subdirectory for one of my shows. I know enough SQL to be dangerous and I would like some feedback on what I did.
I stopped Kodi via ssh and then continued with the following queries in sqlite against MyVideos116.db:
sql:
UPDATE path
SET strPath = '/storage/nas/videos/TV/Riviera/Season 01/'
WHERE idPath = 170;

UPDATE episode
SET c18 = REPLACE(c18, '/storage/nas/videos/TV/Riviera/', '/storage/nas/videos/TV/Riviera/Season 01/')
WHERE idShow = 28;
I found the idShow and idPath relations by querying the tvshowlinkpath table and a bunch of other queries.
After doing that I created the subdirectory "Season 01" and moved the video and subtitle files to it and restarted Kodi. It seems to have worked but I have a nagging feeling that I may have overlooked something.

Can I go on and create a "Season 02" subdirectory and start adding episodes or should I restore a backup and start over?
Create the necessary season folders and move the episodes and their related files accordingly.
Scan for new episodes, and do a Clean Video Library action after that.

That should do it.