Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using Jellyfin for Metadata Management with Unraid and Kodi

Featured Replies

I use Unraid as my media server to store all my movies, with disk spin-down enabled when Unraid isn’t in use, for power efficiency have several disks. All my movie metadata—like NFO files, media art, and cover posters—are stored in their respective folders, When I open Kodi, the movie posters don’t show up immediately because the disks are still spinning up. The movie thumbnails show blank instead of the movie poster, becaue the disk is still waking up. 


Hence I’m thinking of installing Jellyfin to store the metadata so that Kodi can quickly pull movie details, posters, and artwork from the Jellyfin server. I still want to use Kodi as my preferred media player, but I’d prefer to use Jellyfin just for storing the metadata. So can i source jellyfin inside kodi to pull metadata into the Kodi media player? Is this possible? I recall reading a while back that someone suggested using Jellyfin for storing metadata while still being able to use Kodi to display it and play the movies.

  • Community Expert

I use KODI with the KODI database stored in the mysql Docker.  The Docker is using my SSD cache drive to store the database on.  That combination brings up the artwork for over 1500 movies within 5 seconds after I open up 'Movies'.  Obviously, it takes several seconds to actually start the movie playing after finally making our selection. 

 

With KODI, I am using the AeonNox: SiLVO skin.  In that skin, I have the 'View' set to InfoWall.   With 15 posters on the screen and plus when a movie is highlighted, the synopsis and other details about the movie are displayed to the right of the poster field.  When one has as many movies as we do, this combination is a big help in quickly selecting a movie.

Edited by Frank1940

  • Author
15 hours ago, Frank1940 said:

I use KODI with the KODI database stored in the mysql Docker.  The Docker is using my SSD cache drive to store the database on.  That combination brings up the artwork for over 1500 movies within 5 seconds after I open up 'Movies'.  Obviously, it takes several seconds to actually start the movie playing after finally making our selection. 

 

With KODI, I am using the AeonNox: SiLVO skin.  In that skin, I have the 'View' set to InfoWall.   With 15 posters on the screen and plus when a movie is highlighted, the synopsis and other details about the movie are displayed to the right of the poster field.  When one has as many movies as we do, this combination is a big help in quickly selecting a movie.

This is a great suggestion! Could you guide me on how to build the Kodi database, I mean just give me high level steps? Where can I find this option in Kodi settings? Do you install the docker container for mysql db in Unraid? How do you let kodi know that the metadata is in the mysql db? Is there a setting in Kodi to connect to mysql db with user/pass?

Little bit more information will be extremely helpful.

 

I have a cache drive, but I don't use it much because when I copy several GBs of movies to Unraid, it fills up quickly. I have to pause the transfer until the cache drive moves the files to the Unraid pool. How can I prevent the cache drive from transferring my MySQL Docker image to the Unraid pool? Isn't the cache drive supposed to move everything to the Unraid pool at a set time?

  • Author

I did some deepseek probing, and this was the suggestion. Does this align with your steps/strategy?

 

To set up a MySQL database using Docker in Unraid, store it on the cache drive, and use it to store Kodi metadata, follow these detailed steps:

---

### **Step 1: Prepare Unraid and Cache Drive**
1. **Ensure Cache Drive is Set Up**:
   - Go to the Unraid web interface.
   - Navigate to **Main** > **Array Devices**.
   - Ensure you have a cache drive (e.g., SSD) assigned and formatted.

2. **Create a Directory for MySQL Data**:
   - Go to **Shares** and create a new share (e.g., `mysql_data`).
   - Set the **Use Cache Pool** option to **Only** to ensure the data is stored on the cache drive.
   - Note the path to this share (e.g., `/mnt/cache/mysql_data`).

---

### **Step 2: Install MySQL Docker Container**
1. **Install Docker in Unraid**:
   - If Docker is not already installed, go to **Apps** and search for "Docker" to install it.

2. **Install MySQL Container**:
   - Go to **Docker** > **Add Container**.
   - Configure the container as follows:
     - **Name**: `mysql-kodi`
     - **Repository**: `mysql:latest` (or a specific version like `mysql:8.0`)
     - **Network Type**: `bridge` (default)
     - **Extra Parameters**: Leave blank unless you need specific options.

3. **Configure Volume Mapping**:
   - Add a path for the MySQL data directory:
     - **Container Path**: `/var/lib/mysql`
     - **Host Path**: `/mnt/cache/mysql_data`
   - This ensures the database is stored on the cache drive.

4. **Set Environment Variables**:
   - Add the following environment variables:
     - `MYSQL_ROOT_PASSWORD`: Set a strong password for the root user.
     - `MYSQL_DATABASE`: `kodi` (or any name for the Kodi database).
     - `MYSQL_USER`: `kodi` (or any username for Kodi).
     - `MYSQL_PASSWORD`: Set a strong password for the Kodi user.

5. **Deploy the Container**:
   - Click **Apply** to create and start the MySQL container.

---

### **Step 3: Configure MySQL for Kodi**
1. **Access MySQL Container**:
   - Go to **Docker** > **mysql-kodi** > **Console**.
   - Open a shell in the container.

2. **Log in to MySQL**:
   ```bash
   mysql -u root -p
   ```
   - Enter the root password you set earlier.

3. **Grant Permissions to Kodi User**:
   - Run the following SQL commands:
     ```sql
     GRANT ALL PRIVILEGES ON kodi.* TO 'kodi'@'%';
     FLUSH PRIVILEGES;
     ```
   - This allows the Kodi user to access the database from any host.

4. **Exit MySQL**:
   - Type `exit` to leave the MySQL shell.

---

### **Step 4: Configure Kodi to Use MySQL**
1. **Install Kodi**:
   - Install Kodi on your devices (e.g., Windows, Android, or another Docker container).

2. **Edit Kodi’s `advancedsettings.xml`**:
   - Locate the Kodi userdata directory:
     - Windows: `C:\Users\<Username>\AppData\Roaming\Kodi\userdata\`
     - Android: `/sdcard/Android/data/org.xbmc.kodi/files/.kodi/userdata/`
     - Linux: `~/.kodi/userdata/`
   - Create or edit the `advancedsettings.xml` file and add the following:
     ```xml
     <advancedsettings>
       <videodatabase>
         <type>mysql</type>
         <host><Unraid_IP></host>
         <port>3306</port>
         <user>kodi</user>
         <pass><Kodi_Password></pass>
         <name>kodi</name>
       </videodatabase>
       <musicdatabase>
         <type>mysql</type>
         <host><Unraid_IP></host>
         <port>3306</port>
         <user>kodi</user>
         <pass><Kodi_Password></pass>
         <name>kodi</name>
       </musicdatabase>
     </advancedsettings>
     ```
   - Replace `<Unraid_IP>` with the IP address of your Unraid server.
   - Replace `<Kodi_Password>` with the password you set for the Kodi user.

3. **Restart Kodi**:
   - Restart Kodi to apply the changes. It will now use the MySQL database for metadata.

---

### **Step 5: Verify and Test**
1. **Check MySQL Database**:
   - Log in to the MySQL container and check if the Kodi database is being populated:
     ```bash
     mysql -u kodi -p
     USE kodi;
     SHOW TABLES;
     ```
   - You should see tables like `files`, `movie`, `tvshow`, etc.

2. **Test Kodi**:
   - Add media to Kodi and verify that metadata is being stored in the MySQL database.
   - Check multiple Kodi devices to ensure they sync correctly.

---

### **Optional: Backup MySQL Database**
1. **Create a Backup Script**:
   - Create a script to back up the MySQL database to another location (e.g., `/mnt/user/backups`):
     ```bash
     mysqldump -u root -p<Root_Password> kodi > /mnt/user/backups/kodi_backup_$(date +%F).sql
     ```
   - Replace `<Root_Password>` with your MySQL root password.

2. **Schedule Backups**:
   - Use the Unraid **User Scripts** plugin to schedule regular backups.

---

### **Conclusion**
You now have a MySQL database running in Docker on Unraid, stored on the cache drive, and configured to store Kodi metadata. Kodi devices connected to this database will sync their libraries, allowing for a centralized media experience.

 

  • Community Expert

I was a bit afraid when I answered you that you would ask this kind of Question.  I made my KODI setup back in late 2021 and I am now in my mid 80's.  My memory is now foggy about what I did.  I did use an lot of resources at the time and I have them bookmarked in my browser and I will post up those links at the end. 

 

First thing, mysql was not my first choice but I could not get mariadb to setup properly.  I finally went back to trying mysql and followed the setup steps exactly and then that one worked.  Case closed...

 

You do need .nfo files for KODI to work.  I have a semi-flat system for my media files.  It looks something like this: 

  

|Media

|      All_Movies

|         0-9

|         A

|         B

|         C

 

As you should be able to tell that the media is filed alphabetically.  Basically, you require only the .nfo file and the media file (for example, .mkv) for each item.  The scraper does the rest.   My .nfo files are parsing files.  For what I mean by this, read this:

 

          https://kodi.wiki/view/NFO_files/Parsing

 

This is what the file ("Bad_Words.nfo") looks like for "Bad_Words.mkv"

 

https://www.themoviedb.org/movie/209403-bad-words

 

Please understand that I am not grabbing dozens of files each day so my process is almost completely manual.  After I process the source into an .mkv file, I go to the themoviedb website to find the URL for the .nfo file. 

 

     https://www.themoviedb.org/

 

I then copy both the .mkv and .nfo files to the proper spot on my Unraid server.  I start KODI and add the new movie to the KODI database.  (This is a one time operation as Every one of the seven PC in my home that have KODI installed use the same mysql data base!)  The scraper grabs the poster, actors' name and photos, synopsis and any other information needed and adds it to the mysql database which is on my SSD cache drive.  (It is not a separate Unraid share!)

 

Now let me give you the other links that I referred to:

        https://androidpcreview.com/how-to-setup-kodi-the-right-way/

        https://kodi.wiki/view/HOW-TO:Create_Video_Library

        https://kodi.wiki/view/Updating_or_removing_videos#Update_Library-_Manual

 

Steps to add a new movie on my KODI setup:  goto 'SYSTEM'

image.thumb.png.d00674e42059e3330bc90b53e1659f6b.png

 

Then Media: Library:Videos

image.thumb.png.33c2a333f1f9b4aeaf098a6de1f36f76.png

 

Then click on 'All Movies'

image.thumb.png.855f357168d428b3cfd9e01ad0011f76.png

 

Highlight the folder; Right-click on it and select 'Scan for new content'; now wait until it finishes. 

image.thumb.png.9b63ea98b991486b34638fcbe389fe18.png

 

And you are done!

 

Hope this helps....

 

Edited by Frank1940
Right-click was Left-click

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.