Kodi Community Forum

Full Version: MySQL and mixing IP and NetBIOS name in sources
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running Kodi 17.6 on numerous Windows 10 PCs with a shared MySQL DB and content shared from a Windows Server 2012 R2 NAS.
I'm now wanting to add Kodi 18 beta 1 on Xbox One into the mix.

The sources paths on all of my Windows PCs quite happily use \\servername\share\contentfolder convention
On the Xbox One, I've found that I can't seem to resolve the servername in the same fashion and have had to use the server IP address, i.e.\\serverIPaddress\share\contentfolder

If I configure the Kodi on Xbox One to use the MySQL database to access the same content (i.e. music, TV Shows, Movies) but using IP address instead of NetBIOS name for the server in the source path, am I going to somehow mess up the MySQL DB? Will I end up with duplicates of everything due to the source paths not being identical?

Given the full path of each piece of content is stored as strPath in the path table in the myvideos107 db I'm guessing the answer is that is imperative to have identical sources.xml on all devices access the shared MySQL DB..?

If so, what are my best options?
Convert the Windows Kodi installs source paths to server IP instead of NetBIOS name, rescan library, and then I can simply copy the sources.xml over to the Xbox One as-is?
Is there a way of doing a hosts file for Kodi on the Xbox One so it coiuld resolve the server NetBIOS name and thus I could just copy a sources.xml across from my Windows  PC?
Other?
Kodi's database schema is pretty strict. Any deviation from a changed path to a video or music file will result in a "No longer available" message in Kodi for that entry.
IMO, a network based on IP addresses is very reliable, as long as the same IP addresses are used. IP addresses for network devices can easily be fixed on one location: the DHCP server in the internet router.

There is a workaround for the odd/changed network situation, although it's not recommended. There is the option of using "path substitution", which is to be set up in the advancedsettings.xml file. That way you can circumvent resetting your whole Kodi network scrapings.
Thanks for confirming.
yeah, I'll avoid the path substitution option as that can get real messy.

​​​​​​And there's no way of doing a hosts file?
In could've sworn back in the Alphas, when trying to get the NFS sharing working there was something there for this..?
(2018-09-03, 11:07)AnthonyB Wrote: [ -> ]And there's no way of doing a hosts file?
Hosts files should work too, as long as the contents is the same on every connected device so they will redirect correctly.
Sorry, I should have been specific.

Is it possible to do a hosts file with Kodi on Xbox One?
Although the Xbox is Windows under the hood, its pretty much locked down, so I doubt this is possible as on normal Windows you need administrator rights to edit the file.
(2018-09-02, 16:33)Klojum Wrote: [ -> ]Kodi's database schema is pretty strict. Any deviation from a changed path to a video or music file will result in a "No longer available" message in Kodi for that entry.
IMO, a network based on IP addresses is very reliable, as long as the same IP addresses are used. IP addresses for network devices can easily be fixed on one location: the DHCP server in the internet router.

There is a workaround for the odd/changed network situation, although it's not recommended. There is the option of using "path substitution", which is to be set up in the advancedsettings.xml file. That way you can circumvent resetting your whole Kodi network scrapings.
 The more I think about this, I'm wondering if path substitution is the easiest way out..

I've read the Wiki article but I'd like to clarify that it will do what I want in this situation.

So, the problem is that all of my MySQL DB source path data is in \\servername\share\folder format
The Xbox doesn't seem to do NetBIOS name resolution well and thus I need to set my source paths as \\serverIP\share\folder format

If I setup path substitution as follows:

    <from>SMB://servername/share/folder</from>
    <to>SMB://serverIP/share/folder</to>

Will that allow:
1. Kodi on Xbox One to use the serverIP to successfully resolve the share location on my network, AND
2. Path data will be preserved in the MySQL database (shared with Windows PCs) in the format of SMB://servername/share/folder and thus happy co-existence with the Windows PCs running Kodi?

Just want to make sure I under how Path Substitution will work AND that I have the from/to the right way around! Smile

Thanks!
(2018-09-07, 04:54)AnthonyB Wrote: [ -> ]Will that allow:
1) Seeing is believing Smile
2) AFAIK, path substitution only works for reading data, not for writing. But it's been a while since I even tried it myself. 'YMMV'.

To be on the safe side, any new scrapings should be done by the already "working" Kodi client(s).
One test is to scrape a single new video and double-check the database contents (if you are able to).
Another test is, is to find out if the watched status is updated while using the Kodi client with path substitution.
Thanks! All makes sense, I'll give it a shot and see what happens.

One thing I've just realised of course is that the current databases are all from Kodi 17 client and the Xbox running Kodi 18 client has newer database version. So I'll need to install Kodi 18 beta on one of my Windows boxes to trigger a database upgrade and populate the new database versions, verify it is working fine, and *then* drop the new AdvancedSettings.xml on my Xbox and see what happens.