Solved: Kodi not importing newly downloaded episodes

I’m a new convert from SB. I’ve got everything set up and working well with one exception. Sonarr is notifying Kodi correctly when a show is downloaded - I see the GUI bubble notice at the top of Kodi - but the show isn’t importing into the library.

In my Connect settings for Kodi, I have everything set to “on” except for “on grab”.

If I force a library update in Kodi, the episode imports correctly.

I’m looking in System>Logs and don’t see an entry that mentions sending the notice to Kodi.

I’m running Kodi Helix 14.1. For good measure, I also tried enabling XBMC metadata to no effect.

You need to check debug logs to see the connections made to Kodi.

In the XBMC connection settings everything is set to on? Including Update Library?

Yes. I’ve got everything set to “on”.

I’ve enabled debug logs and forced a show to download.

http://pastebin.com/HtsiShsg

I’m not great at reading the log, but I do see the part about the IMDB number.

If it’s relevant, I’ve confirmed in Kodi that all of my TV shows (the root folder) use TVDB for lookups.

Using this imdbnumber thing, I’ve found some other forum posts discussing this, but not a super-clear solution. It seems like the recommendation is to remove the shows from Kodi and re-add them.

So I exported my library (to separate nfo files), removed the shows and re-added my entire TV folder. But that didn’t seem to fix things. I found the same error in Sonarr’s log.

I have also tried this with a new show that I added via Sonarr - a show that wasn’t in my library already. Same error.

Are you using IMDB or TheTVDB for metadata information in Kodi (option when adding the TV folder). Kodi needs to be using TheTVDB for series information to work with Sonarr.

Not sure if exporting IMDB mapped series will result in them using IMDB again when re-imported, but it does seem likely.

I’m using TVDB for the entire TV folder.

I’ve looked in the NFO files that a Kodi export generates and can’t find anything that seems related to that imdbnumber. For example this error for an ep of Last Week w/ John Oliver:

15-2-25 10:08:58.2|Debug|JsonApiProvider|Could not convert string to integer: tt0163503. Path 'result.tvshows[76].imdbnumber', line 1, position 8325.

But there’s no “016503” in the nfo in the shows folder. There’s an empty <uniqueid> node and also a <id>278518</id>

If I decide to go “scorched earth” and remove/add everything again, would I need to delete all of the NFO files that Kodi created during a library export?

Thats TheTVDB ID, so thats good.

Not finding that IMDB leads me to believe its not being persisted there, which is also good, but I can’t really explain why its there again, unless Kodi is putting it there, but it hasn’t done that previously.

You can certainly try removing a show from Kodi, removing the NFO files created during the export and then re-importing, but I’m not sure if it will help, try with one show and take it from there. I’d suggest backing up the NFOs first, just to be safe.

FIXED!

Ok. I was focusing on one show, thinking that was the one with a bad imdbnumber.

I did a “VideoLibrary.GetTVShows” API call that returned all imdbnumbers and found that there were 2 shows that had non-integer (“tt…”) numbers. It wasn’t one of the shows I was importing episodes to, but I guess Sonarr gets the whole list and looks for the correct imdbnumber within that list and that was making it barf on the non-integer.

For future people trying to fix: Do a call like this:

{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "properties": ["imdbnumber"], "sort": { "order": "ascending", "method": "label" } }, "id": "libTvShows"}

Then look at your imdbnumbers (use a web-based JSON parser to make it easier to read). You can try searching for "tt (a quote mark followed by tt - i found that easier than visually scanning…). This’ll help you find the shows that are causing trouble.

I found the individual NFO files that my Kodi export (library export to individual files) created for the offending shows and replaced the bad “tt…” numbers with the correct TVDB IDs. Then I removed the shows and re-imported them and it appears that all is well.

Thanks for the help, markus101!

Awesome. It didn’t ocurr to me before, but yes, we get them all and deserialize it from JSON.

Thanks for letting bus and and providing the fix.