Driver canon pixma ip1880 window 7, Lease termination format india, Gangstar rio city of saints for windows xp, Epson stylus c41sx windows 7 driver, Ios 7 beta 6 legal ipsw iphone 5, Kalavar king telugu movie mp3 songs, Riff for ubuntu 13.04, Diablo 2 lod able items, Cults static zip, I am the bread of life

My Journey from Kodi on x64 to LibreElec on a Pi4

My home setup is a little different from most, but still a supported solution. It involves a central MySQL server on the main household server, media also stored on that server and accessed via NFS, and media playback via Kodi on generic x86/x64 hardware that mounts the above NFS shares and stores Kodi metadata on the MySQL server.

This allows a shared store of playback states, and also a shared store of media information for use by other apps such as Jellyfin, Sonarr, Radarr, etc.

I wished to move to LibreElec just for simplicity sake. I was growing tired of a small form factor PC sitting in the AV cabinet, the Raspberry Pi ecosystem had grown dramatically since I’d made the x86 decision about ten years ago, and the Pi4 finally had enough horsepower to decode 1080p content. I may need to revisit this decision in the years to come when I upgrade to a 4k or 8k television. Additionally, it’s been 6 months since Kodi 19 was released, and it’s not available for the Pi4 yet, but LibreElec Beta with Kodi 19 is.

The first hurdle I had to overcome were the paths that are stored inside the Kodi database. Since the NFS share is mounted at /media/store/, every media file that Kodi refers to in the database has this path. Since LibreElec not permit any filesystem manipulation outside of /storage, a new location will have to be found, and the database will need bulk edited.

To mount the NFS share in /storage/store/, first create the required directory and then create the systemctl unit file as /storage/.config/system.d/storage-store.mount

mkdir /storage/store/

[Unit]
Description=nfs mount script
Requires=network-online.service
After=network-online.service
Before=kodi.service

[Mount]
What=172.24.32.5:/srv/nfs4/store/
Where=/storage/store/
Type=nfs

[Install]
WantedBy=multi-user.target

The new storage mount can now be started by systemctl

systemctl enable --now storage-store.mount

Now to edit the database. There are two tables of importance that I know of – movie and path, within the MyVideos database. MyMusic is also somewhat important, but as I’m really only interested in saving watched status, playback position, etc, it’ll be ok to reimport the Music store.

I use DBeaver for my database manipulation

https://kodi.wiki/view/HOW-TO:Update_Paths_In_MySQL#Modifying_MySQL_Paths

The following SQL statement will change all the paths within the table

Update the movie table

update movie set c22 = replace(c22,'/media/store/','/storage/store/');

Update the path table…

update path set strPath = replace(strPath,'/media/store/','/storage/store/');

Update the art table

update art set url = replace(url,'/media/store/','/storage/store/');

Update the episode table…

update episode set c18 = replace(c18,'/media/store/','/storage/store/');

With the new storage location present, and the database now referencing the correct locations, it’s just a case of rebooting the machine and checking the state of a few sample items.

edit: I later found out that the media locations set up within Kodi were wrong or missing. I simply removed the problematic media sources, without deleting them from the library, and re-added them with their new location. This then allowed the automatic library updates to resume working as intended.

Leave a Reply

Your email address will not be published. Required fields are marked *