Tuesday, December 22, 2015

Update: Trakt.tv and Kodi add-on

I noticed recently that my hack to the Trakt.tv add-on for Kodi had stopped working. My TV shows were no longer updating on the Trakt.tv site. It didn't take a lot of effort to find out what had happened - I just had to look at the Trakt.tv add-on version number. It had been updated (from 3.0.4 to 3.0.5) and pushed out to the Kodi repository. My copy auto-updated to the new version, which of course means my changes were overwritten.

Fortunately this is a simple fix, made easy since the source is all on GitHub. All I had to do was go to my version of the repository, pull a local copy down to my machine, and then sync it to the master branch. Most of the changes were merged automatically. There was one conflict, where the updates from the master branch had touched the same file as my changes. When that happens, Git kindly puts both versions of the text into the affected file, so it's just a matter of opening it and manually putting the conflict in order.

To confirm that everything was working again, I installed Kodi locally on my Windows machine and tested out the add-on. (This is much easier than trying to debug on my FireTV, since it's a pain to read the debug log and change files on that device.) This was the first time I'd done this since my Windows 10 upgrade, and I'm happy to say it went smoothly. Other than fixing silly mistakes (typos, forgetting to copy a file) there were no problems.

Once I knew the change was done properly, the only thing left was to update the version on my Fire TV. Kodi on the Fire TV doesn't like it when you try to directly overwrite an existing add-on. Sometimes it works, but other times it ignores the changes; or worse, stops working altogether. So I uninstalled the Trakt.tv add-on, shut down Kodi, copied over the new add-on as a ZIP file, then restarted Kodi and installed the add-on again. That makes sure the updates are in place, and indeed everything worked again properly.

The reason that all this is necessary stems from my little hack being unofficial. I did submit it to the maintainer of the Trakt.tv add-on, but he didn't want to include it in the official version, and I don't blame him. The hack is very specific to viewing TV programs through the MythTV PVR add-on, and it's fragile in the sense that any change to how TV show titles are displayed are likely to break it. So for now, I'll just continue to merge updates manually. With luck, some future version of Kodi and/or the add-ons will allow a better solution.