Kodi Community Forum
Can't get path substitution to work - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: Can't get path substitution to work (/showthread.php?tid=358883)

Pages: 1 2


Can't get path substitution to work - jubilex - 2020-12-03

Hi, I'm using Kodi Leia (one of the Fritsch builds) on an Amazon Fire TV 4k Stick.

Since the stick has little space with all the Amazon stuff and performance with USB external storage is terrible, I wanted to use path substitution so that thumbnails would be on the same drive on my desktop computer on the network as all my media.

I did this in advancedsettings:

                                             <pathsubstitution>
                                                <substitute>
                                                  <from>special://masterprofile/Thumbnails/</from>
                                                  <to>smb://xxxx:[email protected]/y/thumbnails/</to>
                                                </substitute>
                                              </pathsubstitution>

The <to> smb info is copy-pasted directly from my sources.xml with the folder changed to the one I want to use for the Firestick thumbs (a folder which exists).

I still don't have any thumbnails in Firestick Kodi, and debug log is full of errors I don't understand. Any ideas? 

debug log


RE: Can't get path substitution to work - Karellen - 2020-12-03

(2020-12-03, 04:04)jubilex Wrote: I wanted to use path substitution so that thumbnails would be on the same drive on my desktop computer on the network as all my media.
I'm not an expert on path substitution, but I think you need to share the Textures13.db also. If you don't, the artwork links in your local textures13.db won't match the naming of the artwork in the cache you are trying to substitute to.

How to do this, sorry I don't know but maybe others have done it and can advise.

==Edit==
Just noticed your log, and the error...
xml:
ERROR: SMBFile->Open: Unable to open file : 'smb://USERNAME:[email protected]/y/thumbnails/8/8eb4bbdf.jpg'
unix_err:'16' error : 'Invalid argument'

Maybe something wrong with the "to" path you entered?


RE: Can't get path substitution to work - crawfish - 2020-12-03

I did this just last week with Matrix beta 1, and the performance is great using the Amazon Ethernet adapter (100 Mbps) and the 4K stick, with Thumbnails moved to an SSD shared folder in my Windows 10 system. You seem to be avoiding using passwords.xml, while I am not, and I also use it for my source folders, so that passwords appear only in passwords.xml, never in sources.xml (or advancedsettings.xml, now that I've moved Thumbnails). I left Textures13.db on the stick; not sure why Karellen mentioned it. For me, it's only 4 MB, while Thumbnails is over 1 GB. Moving only the latter solved all my storage concerns basically forever.

Below, my share name is "Kodi", and it has read/write access. You'll need to substitute for SERVER_NAME, USER_NAME, and _PASSWORD. (I wrote _PASSWORD instead of PASSWORD to avoid this: TongueASSWORD, which is how the forum software renders "colonPASSWORD" even inside the syntax block.)

In advancedsettings.xml:

Code:
    <pathsubstitution>
        <substitute>
            <from>special://profile/Thumbnails/</from>
            <to>smb://SERVER_NAME/Kodi/Thumbnails/</to>
        </substitute>
    </pathsubstitution>

In passwords.xml:

Code:
    <path>
        <from pathversion="1">smb://SERVER_NAME/Kodi</from>
        <to pathversion="1">smb://USER_NAME:_PASSWORD@SERVER_NAME/Kodi/</to>
    </path>

BTW, if you turn off sleep on the stick, it will stay on Kodi forever, and you'll never have to see the Amazon UI unless you want to.


RE: Can't get path substitution to work - Karellen - 2020-12-03

(2020-12-03, 07:40)crawfish Wrote: I left Textures13.db on the stick; not sure why Karellen mentioned it.
I had the impression he was sharing the thumbnails cache with another install, but now that I re-read the post I was mistaken.


RE: Can't get path substitution to work - crawfish - 2020-12-03

(2020-12-03, 07:49)Karellen Wrote: I had the impression he was sharing the thumbnails cache with another install, but now that I re-read the post I was mistaken.

Oh OK. To be clear, I'm not doing that. This is just for a single install.


RE: Can't get path substitution to work - jubilex - 2020-12-03

(2020-12-03, 07:40)crawfish Wrote: I did this just last week with Matrix beta 1, and the performance is great using the Amazon Ethernet adapter (100 Mbps) and the 4K stick, with Thumbnails moved to an SSD shared folder in my Windows 10 system. You seem to be avoiding using passwords.xml, while I am not, and I also use it for my source folders, so that passwords appear only in passwords.xml, never in sources.xml (or advancedsettings.xml, now that I've moved Thumbnails). I left Textures13.db on the stick; not sure why Karellen mentioned it. For me, it's only 4 MB, while Thumbnails is over 1 GB. Moving only the latter solved all my storage concerns basically forever.

Below, my share name is "Kodi", and it has read/write access. You'll need to substitute for SERVER_NAME, USER_NAME, and _PASSWORD. (I wrote _PASSWORD instead of PASSWORD to avoid this: TongueASSWORD, which is how the forum software renders "colonPASSWORD" even inside the syntax block.)

In advancedsettings.xml:

Code:
    <pathsubstitution>
        <substitute>
            <from>special://profile/Thumbnails/</from>
            <to>smb://SERVER_NAME/Kodi/Thumbnails/</to>
        </substitute>
    </pathsubstitution>

In passwords.xml:

Code:
    <path>
        <from pathversion="1">smb://SERVER_NAME/Kodi</from>
        <to pathversion="1">smb://USER_NAME:_PASSWORD@SERVER_NAME/Kodi/</to>
    </path>

BTW, if you turn off sleep on the stick, it will stay on Kodi forever, and you'll never have to see the Amazon UI unless you want to.

I believe I do have passwords.xml set up, so I'll try it your way when I get home, leaving user/pass out of the substitution path.

But I still don't understand why it wouldn't be working as-is, with the user/pass directly in the substitution path. That's how my paths are entered in my sources.xml for all my media.


RE: Can't get path substitution to work - jubilex - 2020-12-03

Still doesn't work: log

Relevant errors seem to be at the substitution phase and at the loading the thumbnail phase:

Code:
2020-12-03 13:10:28.785 T:10101   DEBUG: Configuring path substitutions
2020-12-03 13:10:28.785 T:10101   DEBUG:   Registering substitution pair:
2020-12-03 13:10:28.785 T:10101   DEBUG:     From: [/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/Thumbnails/]
2020-12-03 13:10:28.785 T:10101   DEBUG:     To:   [smb://192.168.1.137/y/thumbnails/]
2020-12-03 13:10:28.786 T:10101 WARNING: CSettingsManager: missing version attribute
2020-12-03 13:10:28.787 T:10101  NOTICE: Default Video Player: VideoPlayer
2020-12-03 13:10:28.787 T:10101  NOTICE: Default Audio Player: paplayer
2020-12-03 13:10:28.787 T:10101  NOTICE: Disabled debug logging due to GUI setting. Level 0.
2020-12-03 13:10:28.789 T:10101  NOTICE: Log level changed to "LOG_LEVEL_NORMAL"
2020-12-03 13:10:28.789 T:10101  NOTICE: CMediaSourceSettings: loading media sources from special://masterprofile/sources.xml
2020-12-03 13:10:28.925 T:10101   ERROR: Create - Error( Invalid argument )
2020-12-03 13:10:28.925 T:10101   ERROR: Create - Error creating /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/Thumbnails


and

Code:
2020-12-03 13:10:35.322 T:10167 WARNING: SMBFile::OpenForWrite() called with overwriting enabled! - smb://USERNAME:[email protected]/y/thumbnails/7/7040c666.jpg
2020-12-03 13:10:35.325 T:10167   ERROR: SMBFile->Open: Unable to open file : 'smb://USERNAME:[email protected]/y/thumbnails/7/7040c666.jpg'
                                            unix_err:'16' error : 'Invalid argument'


SMB address, user, and password are correct as they are the same I use for all my media.


RE: Can't get path substitution to work - crawfish - 2020-12-03

I do get the "WARNING: SMBFile::OpenForWrite" so I assume it's normal. I don't get the ERROR right after it, however. Maybe check the permissions on your share?


RE: Can't get path substitution to work - jubilex - 2020-12-04

(2020-12-03, 20:55)crawfish Wrote: I do get the "WARNING: SMBFile::OpenForWrite" so I assume it's normal. I don't get the ERROR right after it, however. Maybe check the permissions on your share?

i've got full permissions for that username/password on the shared folder.

The error when trying to open the thumbnail jpg -- the jpg does not exist. I don't know where that filename is coming from. I tried deleting my texture13.db file and I still get the error, still looking for jpgs that don't exist. Also the earlier error where it tries to create the Thumbnails folder in the original spot on the Fire Stick (I don't know why it is trying to do it there since path substitution is on), I've deleted that folder and it never seems to get recreated.

So where I currently am is on the Firestick I've got no Thumbnails folder and no Texture13.db, and I've got path substitution to a SMB shared empty Thumbnails folder. When I start Kodi, it recreates the Texture13.db and gives me errors in the log that it can't create the Thumbnails folder on the Firestick, and then later that it can't open the (non-existent) jpg files in the thumbnail folder on the SMB.

Wtf?

Here's the earlier log, nothing relevant has changed in it with my changes: https://paste.kodi.tv/ufijisizab.kodi


RE: Can't get path substitution to work - crawfish - 2020-12-04

Two other differences I can see:
  1. You're using Leia, while I'm on Matrix beta 1.
  2. You're using special:masterprofile, while I'm using special:profile.
No idea if either matters. I haven't tried this before Matrix. As I said before, I do get those warnings, but they're never followed by your errors, and it all works very nicely and snappily.


RE: Can't get path substitution to work - jubilex - 2020-12-04

I've also tried special:profile.

This thread seems to have several people with the same problem, from 2014 to 2020: https://forum.kodi.tv/showthread.php?tid=206585


RE: Can't get path substitution to work - crawfish - 2020-12-04

I'm also using the computer name instead of its IP address and "Thumbnails" for the share name instead of "thumbnails". The former shouldn't matter, and I'd hate to think it's a case sensitivity problem, but... it's a mystery.


RE: Can't get path substitution to work - jubilex - 2020-12-04

Unfortunately not, in my current version everything matches case. Also that jpg does not exist in the SMB thumbnails folder - the folder is empty - so by "unable to open file" I assume it means "unable to open for writing" and not that it can't find it (since it doesn't exist yet)?

I've also tried both "profile" and "masterprofile" in the substitution, as well as computer name vs IP.

Current advancedsettings:

Code:
<advancedsettings>
  <videoscanner>
    <ignoreerrors>true</ignoreerrors>
  </videoscanner>
  <musiclibrary>
    <backgroundupdate>true</backgroundupdate>
  </musiclibrary>
  <videolibrary>
    <cleanonupdate>false</cleanonupdate>
  </videolibrary>
  <video>
    <ignorepercentatend>10</ignorepercentatend>
    <playcountminimumpercent>90</playcountminimumpercent>
    <ignoresecondsatstart>60</ignoresecondsatstart>
  </video>
    <pathsubstitution> 
        <substitute>
             <from>special://profile/Thumbnails/</from>                    
            <to>smb://192.168.1.137/y/Thumbnails/</to> 
        </substitute> 
    </pathsubstitution>
  <loglevel hide="false">3</loglevel>
</advancedsettings>

I changed log level to 3 and have a new log, don't know if it helps; this is a fresh log after deleting Textures13.db, with an empty SMB Thumbnails folder: 

https://paste.kodi.tv/jetagejucu.kodi


With log level 3 if there were any authentication errors with SMB it should show in the log, right?


RE: Can't get path substitution to work - Klojum - 2020-12-04

(2020-12-04, 22:33)jubilex Wrote: right?

Why are you using two separate forum threads with the same posts on the same topic?


RE: Can't get path substitution to work - jubilex - 2020-12-04

(2020-12-04, 23:12)Klojum Wrote:
(2020-12-04, 22:33)jubilex Wrote: right?

Why are you using two separate forum threads with the same posts on the same topic?

Because I'm not sure if the problem is with the windows SMB folder being substituted, or with the Android fire stick kodi installation, and assume most people don't check all the support forums.