Adding music with shared SQL database
#1
I have all my media on a Linux server using a SQL database that is accessed locally and also from 2 other Kodi instances. This has been working fine for videos for over a year.

Yesterday I finally got around to adding music for the first time. On the Linux server, I added the music source (smb://192.168.1.2/Media/Music/) and it all got scanned. On the server, I have the Kodi "Files" view of my filesystem layout of the Music directory tree plus all the automatic metadata views like Genres, Artists, Albums, etc.

Then I looked at one of the another Kodi instances and the metadata views are there automatically but not the Files view. If I add the music source (smb:...etc...) it re-scans all the files. I don't understand why or where it is writing the scanned info, on the Linux server (again) or the local library on this Kodi box?

I've done this twice on a remote instance. The first time I added the music source but said NO to add to library. I _think_ later when I went to play an album it did a scan on the fly. I blew everything away on all instances and started over. The current state is with no Music source added on the remote instance yet.

What I need to have is the Files view on all Kodi instances.

It makes me wonder if I did my videos correctly. I copied the sources.xml file from the Linux server and placed it on the kodi boxes and get the video Files view everywhere. I have "scan library at startup" OFF and I never need to scan any videos on the networked Kodi boxes.
Reply
#2
I forgot to add that I'm currently running Jarvis but I'll be updating to Krypton in the next week or two.
Reply
#3
Just copying the sources.xml file to each Kodi client is not enough for using a shared mysql library. It is not auto-created.

Read the following wiki page for more info: http://kodi.wiki/view/Set_content_and_scan
Reply
#4
Klojum, right, I repeated the set content steps on the remote kodi instances. But, am I wrong that since the server scans automatically (I use the watchdog addon) that the remote instances don't ever have to scan at all? Or are these instances scanning without me knowing it? New shows on the server automatically appear in the "Files" view on the remote boxes.

That gets me back to my original question, that I'm surprised I have to re-scan all the music file tags on the remote instances to get the music Files view there. It seems like the metadata would come from the SQL server. I thought that adding the music Source would allow the Files view, but that scanning music tags would not need to be re-done on the remotes.
Reply
#5
I never used the Watchdog addon. I know from the OpenELEC days that it can cause quite the mayhem, and not for the better.
The Files view IMO is simply seeing files a on server. That has nothing to do with movies, tv shows or music videos being properly scraped into the Kodi libraries.

Sources that are properly scanned are accessed directly via their respective menu items: Movies, TV Shows, Music etcetera.
But perhaps you are using the term 'Files View' incorrectly. Perhaps you can upload a couple of screenshots and link them here so we can see what you actually mean.
Reply
#6
Post your advancedsettings.xml from the machine which is working, and the same from a non-working machine. My guess (since you've not mentioned this) is that you haven't added the MySQL music database settings to advancedsettings.xml and all your clients are creating local SQLite MyMusic databases.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#7
Thanks for your interest and help. Much appreciated!

The Files "view" that I refer to is an entry in the Library view for both music and videos. For Music, it looks like this:

Music - Library
Genres
Artists
Albums
Singles
Songs
Years
Top 100
Recently added albums
Recently played albums
Compilations
Playlists
Files
Music add-ons

The "Files" item near the end is simply looking at the sources that have been added, yes, just looking at the server like a file browser. I could spend a lot of time tagging all my files such that the database maybe gives me the organization I want, but I already have this organization in my directory tree and I access those files by other means besides Kodi.

For music, on the remote instances, the Files item is empty unless I add a source for the directory tree on the server. I can play the music without adding the source though, and clearly the server's metadata is being used by the remote kodi. When I add the source, the Files view then gives access to the server directory tree, but I'm surprised that it seems to scan the music when I open a folder (I said NO to add the files to the library when I added the source). I thought it would just use the metadata on the server (like I believe videos do?). I gather it must be re-writing the server music metadata when it does this?

I'm obviously not understanding the proper use of a shared SQL database. Maybe for videos and music both, you're _not_ intended to add all the sources to all the instances, just the one where you add media? I could have sworn the instructions said to copy the sources.xml file to each instance, but I checked just now and it says to just copy the advancedsettings.xml file. Oops! It was a couple of years ago but I probably added the Video sources to the remotes in order to get the Files view for videos, not realizing what was really happening.

I switched to a shared SQL database for videos, for watched flags and progress markers. Since Music doesn't seem to use either feature, I think I'm not getting any benefit of the shared database for music if I insist on adding the sources to remote instances in order to get the Files view. If it really is re-writing the database info from re-scanning the tags over the network, then if anything it just makes the remote kodi's run slower.

Do I have any of the above right yet?
Reply
#8
Milhouse, I have the same advancedsettings.xml file (both video and music defined as SQL) on all instances. Without any sources defined on the remotes, just the advancedsetting.xml file in place, all instances work the same in that all the Library views of music that I just listed above work fine everywhere and I can play the files. It's just that the Files "view" is empty on the remotes unless I add a source pointing to the server directory (smb:...). So, clearly the MySQL database on my Linux server is working for Music. Now I'm just trying to get my head around what actually happens when I add a seemingly redundant source to a remote instance so I can see the "Files". If it is indeed scanning the tags over the network and then re-writing the SQL database metadata over the network, then maybe I should have each instance use a local Music database and only share the Video database?
Reply
#9
I'm kind of losing sight of the real issue, assuming I ever really saw it... Smile

It may not apply to music, but as a basic security mechanism the media path from the db should be present in sources.xml on the client in order for Kodi to play it. So the simplest solution is to have all your sources present on all your clients (ie. same sources.xml everywhere) to avoid one or more clients refusing to play content when the path is missing from their sources.xml.

If you've added sources.xml to your remote client, but the Files view is still empty, then post a debug log (wiki).
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#10
Sorry for the hard-to-follow posts...

The issue is simply that without adding the server source to remote clients, the Files view is empty. If I add the source through the GUI, then the Files view is fine, but the client seems to re-scan all the files on the server. This is a surprise to me, and I'm wondering if it is actually re-writing the metadata to the server SQL database.

I'm assuming that manually adding a sources.xml file to an instance is identical to going through the Add Music option in the GUI. For Music, I used the GUI.
Reply
#11
(2017-11-04, 22:56)rickm Wrote: I'm assuming that manually adding a sources.xml file to an instance is identical to going through the Add Music option in the GUI. For Music, I used the GUI.

In theory, yes, adding sources via the GUI should be the same as copying sources.xml but any difference may result in a different path being scraped and added to the database, so it's generally easier/safer to copy the xml around rather than manually add via the GUI on each client. I can't remember if you need to set content for each source once you've copied the sources.xml to the remote clients - I'm thinking you don't, but if you do set content then simply click no when prompted to scan.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#12
I think I'll abandon this until I upgrade to Krypton in case it has been improved. Even on the server Kodi, when I go into a large "album" from the Files view, it says "Loading media information from files..." every time I re-enter the album. It does the same from the remote Kodi. That makes no sense to me. (It's an audio book with over 300 little mp3 files). I notice however that it doesn't do this if I open the album from one of the metadata views, such as "Album". It could be smarter than that.
Reply
#13
I am not sure I understand your issue and I don't use client/server myself (hence my silence so far), it seems to be about file view of music
(2017-11-05, 04:35)rickm Wrote: I think I'll abandon this until I upgrade to Krypton in case it has been improved. Even on the server Kodi, when I go into a large "album" from the Files view, it says "Loading media information from files..." every time I re-enter the album. It does the same from the remote Kodi. That makes no sense to me. (It's an audio book with over 300 little mp3 files). I notice however that it doesn't do this if I open the album from one of the metadata views, such as "Album". It could be smarter than that.
When you have settings>media>music "Enable Tag Reading" enabled this is the standard fileview behaviour. Disable this setting if you do not want it to attempt to read embedded metadata, or use the music library.

IMO an upgrade is still worthwhile but this has not changed in Krypton.
Reply
#14
(2017-11-05, 13:02)DaveBlake Wrote: When you have settings>media>music "Enable Tag Reading" enabled this is the standard fileview behaviour. Disable this setting if you do not want it to attempt to read embedded metadata, or use the music library.

IMO an upgrade is still worthwhile but this has not changed in Krypton.
I couldn't find this option in Jarvis at first, but found it under settings->music->file lists. I turned it off, blew away the music library and re-added the source. It's just what I want (for now). I love the metadata for Video, but it doesn't fit the way I access my music. I think I will make an effort to somehow populate more of the album thumbnails though.
I have to update my Debian Jesse server to Stretch, which I'm doing today. The update to Krypton will come along with it.
Thanks everyone!
Reply
#15
Running Krypton 17.5 now. I'm keeping the music as files only and not scanning tags into the library. This is just what I need for now.

I let it search the server folders for folder.jpg (album covers). They don't appear until I enter an album folder but after that, they show up in the album folder listing. I couldn't find a way to have it scan all the folders looking for album covers, but no big deal.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding music with shared SQL database0