Thursday, June 23, 2016

Kodi Add-On for Update

I've been updating my customized version of the Kodi add-on for fairly regularly. Each time the original add-on changes, I have to re-apply my modifications. I finally decided recently that it was time to try to get my changes included in the base add-on.
The first thing I wanted to do was make sure my modifications were completely optional. My updates provide two added features: attempt to scrobble MythTV PVR recordings, and do a Trakt text search by show name if the show can't be found on the first attempt (which was part of my original Crunchyroll integration changes). So I added two new options in the add-on configuration screen, under the Scrobbling section, one for each feature. By default, they'll be disabled. Thus when my additions get pushed out to the general public, nothing will change for anyone unless they specifically enable the new options.
Having tested and committed those changes, I submitted a request to pull my modifications into the base add-on. The maintainer had a few suggestions, which were easy to implement. He also asked me to rebase my changes, which basically means to consolidate all the different updates I've made, so that it looks like a single change from his perspective. That makes sense, so that it's simple to see everything that I'm asking to add in one place.

Unfortunately, this rebase process isn't as simple as it sounds. Git has a rebase command, and I tried to use it against the base add-on branch. But it kept giving me errors that no amount of Google searches explained, so clearly I was doing something wrong. In the end, I finally realized that I was able to simply ignore the error and override it with a forced push to the repository. Generally that's a very bad thing, since you can lose changes that way, but in this case it's what I wanted to do.

Once I got past the learning curve on the rebase command, the rest was fairly simple. The post-rebase changes were broken into two pieces, one for each new feature, and submitted as a pull request. Those features are now part of the main repository, listed as part of the version 3.1.8 update.

It's nice to have these features in the standard distribution for the Kodi add-on for I'll still have to make updates to it when something changes in the way Kodi and/or works, but at least now unrelated changes to the add-on won't require me to re-apply my modifications.

No comments:

Post a Comment