Fixing Kodi freezing for a few seconds before playing

I use Kodi on Nvidia Shield to watch movies and TV shows. At some point, Kodi developed an issue: every time I press “play,” it freezes for 4 seconds as if nothing happens, then starts playing. It wasn’t a network issue. Reboots also didn’t help. The debug logs had no entries about what was happening during that time. I found a solution on a forum: contents of the’temp’ folder could mess up with…