I recently made two big changes, and to be honest, i’m not sure which one may have caused this issue. The issue is that on the TV show source, I’m not seeing the list of shows and then episodes. All I get is the folder view with the files in it.
The changes I made recently are:
- I moved my content and MySQL database to a new server. Everything else appears to be working normally though. The movies folder works fine. So i’m not suspecting a problem with the data move.
- I upgraded to the krypton based OSMC builds. Kinda by surprise. I didn’t check what the updates were going to bring before hitting the button.
I did check and my content is in fact set to TV shows on this folder. When I update the library, I see the popup appear and the names of each show pass by. But I still don’t get a shows list.
Any advice on where I should be looking to solve this?
In the logs? They are designed so that Kodi will tell you exactly where it’s having issues.
I now have it solved. Not sure why it didn’t work the first time.
The log file did help. I just didn’t know where to find it. After a bunch of googling, I learned that it’s in /home/osmc/.kodi/temp.
After wading thru the logs, I found a few problems. First was that some of the views didn’t exist. Secondly was that there were still a few references to the old path locations.
When I initially did the database transfer, I used the data migration wizard in MySQL workbench. I do remember it failed to create a few of the views. I didn’t worry about it at the time because I assumed it would get rebuilt when kodi touched the DB. Bad assumption on my part. I guess it only creates the database objects as one big operation if the whole DB doesn’t exist. It doesn’t do it piecemeal.
As to why it failed, I dropped the whole schema on the new server and migrated it again. This time I saw the errors and looked more closely. It failed to create the views, because the tables didn’t exist yet when it tried. They were created later in the migration order. So I simply ran the create schema objects step again (choosing to not recreate existing objects) and it successfully created the handful of objects that failed the first time.
Then came the data migration. It had a handful of failures the first run thru. So I tried the same process as above and ran it again. This was a mistake. It created duplicate records in the destination DB for a second copy of each source record. It only affected the TV show related stuff in my case, and I only have 6 shows, so I tried the surgical approach first. That proved to be more confusing than I wanted to deal with. and I ended up messing it up worse than it was.
So I decided to switch gears and delete the whole DB wholesale, and try a different approach. This time I opened the old DB, created an export file making sure to export all objects. I then opened the connection to the new server and imported that file. I then ran my script to update all of the path references to the new server locations. I then rebooted the pi to refresh it. Now everything seems to work properly.
For the benefit of anyone else who may stumble upon this. Here’s my SQL script to update the paths in the database:
-- Tested on Kodi Krypton 2/26/17
SET @videoDatabase = 'myvideos107';
SET @oldPath = '//SERVER7';
SET @newPath = '//SERVER8';
SET @oldMovieServer = '//SERVER7/Movies/';
SET @newMovieServer = '//SERVER8/Movies/';
SET @oldTVServer = '//SERVER7/TV Shows/';
SET @newTVServer = '//SERVER8/TV Shows/';
update path set strPath = replace(strPath,@oldPath,@newPath);
update movie set c08 = replace(c08,@oldMovieServer,@newMovieServer);
update movie set c20 = replace(c20,@oldMovieServer,@newMovieServer);
update movie set c22 = replace(c22,@oldMovieServer,@newMovieServer);
update art set url = replace(url,@oldMovieServer,@newMovieServer);
-- TV Shows
update episode set c18 = replace(c18,@oldTVServer,@newTVServer);
update tvshow set c16 = replace(c16,@oldTVServer,@newTVServer);
Thank you for posting the nice helpful script. Hopefully others can benefit from your work!