Difference between revisions of "Path substitution"

From Official Kodi Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{mininav| [[advancedsettings.xml]] }}
 
{{mininav| [[advancedsettings.xml]] }}
 +
 +
<section begin="intro" />[[Path substitution]]s are settings in [[advancedsettings.xml#<pathsubstitution>|advancedsettings.xml]] to force Kodi to use different file paths. These are processed in order, and are useful for substituting an absolute path on a PC with a path suitable for Kodi to handle. Path subs work for most file and folder paths. Path subs work across local and network paths, across different network protocols, and can even be used with some of the [[special protocol]].<section end="intro" />
 +
 +
== Special notes about path substitution for userdata files ==
 
{{divbox|orange||<big>'''Note:''' This is considered an advanced (complicated) and experimental feature.</big><br /><br />Path substitution is not officially supported for settings files with the exception of playlists. It probably won't hurt anything, but some things might not always work right depending on what you are substituting.<br /><br />
 
{{divbox|orange||<big>'''Note:''' This is considered an advanced (complicated) and experimental feature.</big><br /><br />Path substitution is not officially supported for settings files with the exception of playlists. It probably won't hurt anything, but some things might not always work right depending on what you are substituting.<br /><br />
 
;<big>Thumbnails</big>
 
;<big>Thumbnails</big>
Line 5: Line 9:
 
Since sharing of the database is not realistically possible, attempts at sharing only the Thumbnails folder will either fail completely, or result in some artwork items never being displayed, or you may experience artwork being displayed but with higher or lower than expected image quality or even image corruption (a result of different clients overwriting previously cached artwork, as not all clients cache artwork at the same resolutions, or even use the same image formats).<br/><br/>
 
Since sharing of the database is not realistically possible, attempts at sharing only the Thumbnails folder will either fail completely, or result in some artwork items never being displayed, or you may experience artwork being displayed but with higher or lower than expected image quality or even image corruption (a result of different clients overwriting previously cached artwork, as not all clients cache artwork at the same resolutions, or even use the same image formats).<br/><br/>
 
If you must use Path Substitution to relocate (rather than share) your Thumbnails folder, by all means do so but only for individual clients and their associated Thumbnails folder. Do <strong>not</strong> share a single Thumbnails folder between multiple clients, as the Texture Cache is simply not designed to support this and you will experience problems.}}
 
If you must use Path Substitution to relocate (rather than share) your Thumbnails folder, by all means do so but only for individual clients and their associated Thumbnails folder. Do <strong>not</strong> share a single Thumbnails folder between multiple clients, as the Texture Cache is simply not designed to support this and you will experience problems.}}
<section begin="intro" />[[Path substitution]]s are settings in [[advancedsettings.xml#<pathsubstitution>|advancedsettings.xml]] to force Kodi to use different file paths. These are processed in order, and are useful for substituting an absolute path on a PC with a path suitable for Kodi to handle. Path subs work for most file and folder paths. Path subs work across local and network paths, across different network protocols, and can even be used with some of the [[special protocol]].<section end="intro" />
 
  
 
== Examples ==
 
== Examples ==

Revision as of 15:23, 18 August 2015

Home icon grey.png   ▶ advancedsettings.xml ▶ Path substitution

Path substitutions are settings in advancedsettings.xml to force Kodi to use different file paths. These are processed in order, and are useful for substituting an absolute path on a PC with a path suitable for Kodi to handle. Path subs work for most file and folder paths. Path subs work across local and network paths, across different network protocols, and can even be used with some of the special protocol.

1 Special notes about path substitution for userdata files

2 Examples

Save as "advancedsettings.xml" in your userdata folder:

Example 1 - changing the path of music files
<advancedsettings>
 <pathsubstitution>
  <substitute>
    <from>SMB://192.168.1.19/Music/</from>
    <to>G:\Music\</to>
  </substitute>
 </pathsubstitution>
</advancedsettings>


Example 2 - changing where thumbnails are stored

Note: This will slowdown thumbnail loading, but might be worth it for low-memory devices. See also HOW-TO:Reduce disk space usage.

<advancedsettings>
 <pathsubstitution>
  <substitute>
    <from>special://profile/Thumbnails/</from>
    <to>PROTOCOL://YOUR_NETWORK_SHARE/Kodi/userdata/Thumbnails/</to>
  </substitute>
 </pathsubstitution>
</advancedsettings>


Note: Not all special paths can be substituted. In particular, special://musicplaylists/ and special://videoplaylists/ should not be substituted, as internally these are multipaths that cannot be written to (thus saving of playlists will go elsewhere). Instead, one should use the advanced setting <system><playlistpath> to change this.

3 See also