(2012-04-02 08:55)MatsF Wrote: Substitute masterprofile/addon_data doesn´t work for XBMC Subtitles
Again about this issue, had the same problem, I guess like most people wanting to share an xbmc library.
I've gived a look at plugin's code to understand and here is the detailed explanation:
- Plugin downloads the subtitles in a local folder
- Using python code in local userdata/addon_data/script.xbmc.subtitles/sub_tmp
- > no path substitution there
- As amet explained, a plugin (python) cannot easily handle remote files (smb://...)
- Then it attempts to unzip the subs, but in substituted path
- Using XBMC.extract() builtin (not python) that substitutes paths
- Which fails, not being the local addon_data path where the subs are, but substituted one like smb://whatever
I see several solutions to this:
- Easy: do not write temp files in addon_data but somewhere else like "/tmp/" (unix) or else (windows...)... that way Extract does not substitute (tested)
- Possible: Do not use XBMC.Extract... no idea how it can be possible to do that in python... sounds tricky probably a dead end.
- Unlikely: Hope for some sort of xbmc new feature that would allow plugins to deal better with path substitutions... (Looked a bit, did not found any xbmc builtins of stuff like that that could help)
Amet, what about adding a tmp_sub_dir plugin configuration setting? Or maybe just an advanced setting.
Set to nothing by default, would let current plugin behavior using addon_data... Would use specified path otherwise.