2018-08-04, 21:14
A little backstory. I've been using Kodi with a shared mysql database for a while now across several types of devices including Raspberry Pis, Android devices, Windows PCs, and Linux machines. This was all done using SMB paths configured inside Kodi. I've recently had major issues with performance of videos playing over these SMB paths and wanted to start using SMB paths mounted via the system (i.e. either fstab, or Windows mapped drives). My problem is that each system type will have a different type of path such as /mnt/Movies or Z:\Movies. What I was hoping to do was utilize path substitution configured differently for each device type to redirect smb://Movies to either /mnt/Movies or Z:\Movies. This will solve the problem of requiring different paths in addition to me not having to rebuild my database with the new paths. I've tried configuring this on my Raspberry Pi running OSMC but I can't seem to get it to work and I think it might have something to do with the path syntax.
For the case of the Raspberry Pi. Paths currently configured in the DB for movies are smb://MAX-SERVER/Max's Home Folder/Videos/Movies. I've successfully mounted this share as /mnt/Movies and can browse the file structure there with no issues. When I configure the path substitution in advancedsettings.xml as shown below, the settings are read according to kodi.log but when I actually play a movie the log shows the full SMB path as the source of the video file as opposed to /mnt/Movies suggesting that the substitution is not working.
I've already tried modifying the paths in the advancedsettings.xml file to include trailing slashes, surrounding the paths in quotes, replacing the apostrophe with the proper XML escape sequence, and replacing "smb://MAX-SERVER/Max's Home Folder" with "..", but none of this seems to work.
If anyone can shed any light on whether I am doing this wrong entirely, if my advancedsettings.xml syntax is incorrect, or if this is working and the log output is expected that would be great. Once I get it working on the Pi I should be able to adapt similar configurations for the rest of my devices. Thanks in advance for any help.
<pathsubstitution>
<substitute>
<from>smb://MAX-SERVER/Max's Home Folder/Videos/Movies</from>
<to>/mnt/Movies</to>
</substitute>
<substitute>
<from>smb://MAX-SERVER/Max's Home Folder/Videos/TV</from>
<to>/mnt/TV</to>
</substitute>
</pathsubstitution>
For the case of the Raspberry Pi. Paths currently configured in the DB for movies are smb://MAX-SERVER/Max's Home Folder/Videos/Movies. I've successfully mounted this share as /mnt/Movies and can browse the file structure there with no issues. When I configure the path substitution in advancedsettings.xml as shown below, the settings are read according to kodi.log but when I actually play a movie the log shows the full SMB path as the source of the video file as opposed to /mnt/Movies suggesting that the substitution is not working.
I've already tried modifying the paths in the advancedsettings.xml file to include trailing slashes, surrounding the paths in quotes, replacing the apostrophe with the proper XML escape sequence, and replacing "smb://MAX-SERVER/Max's Home Folder" with "..", but none of this seems to work.
If anyone can shed any light on whether I am doing this wrong entirely, if my advancedsettings.xml syntax is incorrect, or if this is working and the log output is expected that would be great. Once I get it working on the Pi I should be able to adapt similar configurations for the rest of my devices. Thanks in advance for any help.
<pathsubstitution>
<substitute>
<from>smb://MAX-SERVER/Max's Home Folder/Videos/Movies</from>
<to>/mnt/Movies</to>
</substitute>
<substitute>
<from>smb://MAX-SERVER/Max's Home Folder/Videos/TV</from>
<to>/mnt/TV</to>
</substitute>
</pathsubstitution>