Question regarding xbmc.translatePath()
#1
I'm not sure if I have come across a bug or not... First I'll see if my knowledge is correct...

translatePath() is needed to translated XBMC paths into true file paths(XBMC Paths include special:// and smb://) If I pass a path that is proper, XBMC should return the same path.


If this is correct, then I think there is a problem...

If a Mapped drive is passed to translatePath(), it returns a modified file path(which seem to use the special://temp/ to make a path)

For example:

Code:
path = "Z:\\Video\\Misc\\TheaterExperience\\AudioIntros\\
t_path = xbmc.translatePath( path )
print t_path

this prints t_path which becomes.

Code:
C:\\Users\\HTPC\\AppData\\Roaming\\XBMC\\cache\\Video\\Misc\\TheaterExperience\\AudioIntros\\

Looking at the xbmc.log file special://temp/ is

Code:
21:12:55 T:2308 M:2706006016  NOTICE: special://temp/ is mapped to: C:\Users\HTPC\AppData\Roaming\XBMC\cache

I need to use translatePath() since users can put a smb:// path in to the option I am using...
Reply
#2
For samba paths, I think you could use validatePath: http://passion-xbmc.org/gros_fichiers/XB...lidatePath
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#3
smb:// paths will not work once we go to an unwrapped (external) python.

The Z:/ thing appears to be a bug that is a hangover from where we used xbox drive letters for various things. special://foo/ is the only thing that should be translated.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#4
I know this is an old thread, but is there no builtin solution to translate smb paths to valid paths?
In my addon, I get a smb path with a <setting type="folder" ... /> element.
Neither xbmc.translatePath() nor xbmc.validatePath() change the input "smb://hostname/share/" to a valid output like "\\hostname\share" on windows.
I could use xbmcvfs.copy() and xbmcvfs.exists() to access the file, but this does not seem like an efficient solution.
Reply

Logout Mark Read Team Forum Stats Members Help
Question regarding xbmc.translatePath()0