Thursday, January 1, 2026

Kodi on Ubuntu 24.04

Recently I decided to move back to a slightly larger media entertainment system, having use the Raspberry Pi 4 for a couple of years with 12TB of external USB storage.

The new system from mini-itx.com, came in a tidy little chassis which housed the AMD Ryzen 7 processor, 16Gb RAM, 1 x 2GB NVMe, 1 x 4TB NVMe and 2 x 4TB SSD, and Intel AX210NGW wireless card which works perfectly with the AMD CPU.

Installing Ubuntu 24.04 is as always nice and straight forward, installing the bare minimum. Kodi is now part of the Ubuntu repo, so also straight forward.  The Ubuntu installation with Kodi supports a Microsoft MCE style I.R. remote reasonably well, unlike other systems.

Once the media libraries were in place I have a Python script that allows me to set or unset watched flag in bulk.

My favourite skin is the Aeon NOX: Silvo.  Once I'd got everything as required then came the serious element of watching.

Another feature was to make use of Kodi's UPNP feature to enable LG TV's media player and Roku media player to stream media from the Kodi system and provide the same convenient method of browsing the files, without having to deal with files missing because the library couldn't understand the file, which is the issue you get with systems such as Emby, Jellyfin and others.  So Kodi works better when sharing media to other devices, and easier to find what you want.

After a while it became apparent that Kodi wad temperamental in shutting down using the menu.  Searching the internet provided various solutions;
- polkit fixes due to permissions required to allow the user to shutdown the system without requiring sudo.
- kernel setting through Grub to deal with BIOS power drivers.

There were some others, but after trying these, nithing worked.  Even trying to use Mint, only made things worse as the MCE controller didn't work as well and it still didn't shutdown.

The solution to the shutdown problem, after reverting back to Ubuntu, turned out to be the most obvious, but the least obvious, since it was not posted anywhere.  The solution:

Use the default skin Kodi is installed with.  This fixed all the problems.

The next problem, was that of a disappearing and temperamental UPNP service.  This was due to their being configuration in multiple locations;
- upnpsettings.xml
But there are others.  Not in the database files.

I've yet to look for where else the UPNP service is configured, but a fresh .kodi directory and copying your original database directory back in and configuring UPNP service resolved the issue.

Finally, I like to see what's coming, and IMDB Trailers is a must.  This is a fix that is well documented on the internet, which requires you to set the cacerts as Kodi and its plugins tend to have the wrong certs.  The following command fixes this issue;

ln -s /etc/ssl/cert.pem /usr/share/kodi/system/certs/cacert.pem.

KODI watched Episodes

The issue

Although Kodi is one of the better media centres out there, and I've been using it for some while ever since mediaportal went down hill, there have been some annoying changes that the developers make in removing key features from the user interface that are essential to the way people watch stored programs, such as;

How do I remove all the ticks for a watched TV series or program?

Kodi when it was XBMC and with the Confluence skin used to have a very useful option that if you right clicked the TV Series folder, you could unwatch the entire series.  When rebadged as Kodi they decided that this feature wasn't something people used - typical of developers who don't use something themselves, or talk to their community enough.

Having dug through some Kodi docs, and helpful people on line that have tried to solve this scenario, and without having to go through each item one by one to untick them I'm on the quest to write a script, and possibly a plug-in that will solve this long lost useful item of the media centre (yes I'm British so I will spell centre in this way, for the rest of you translate to center, until the UK and USA become a continent now that Brexit is in full swing and Europe in continuing to do what they've always done).  Tell you what though it would be a more impressive tunnel :-)

Sorry, I digress on issues that are of no interest at this moment in time.

The Tools

To achieve the desired result we need to now dig in to the Kodi database which is stored in the users home directory that you run Kodi as;

$HOME/.kodi/userdata/Database

From here we will need to work with the MyVideo??.db file, in my case MyVideo99.db

These files are sqlite3 database files so the following will be of use;
  • sqlitebrowser
    • A graphical tool for easily viewing the schema
  • sqlite3
    • CLI tool for working with these database files
    • Handy if you prefer to write Shell scripts to control the DB schema and data
  • sqlite3 python library
    • import sqlite3

The Table

The table required is called files.