2010-10-28, 00:09
vaton4 Wrote:To Kabooga:
Found that in the XBMControl.js there is something strange ....
I still don't understand fully the source so I didn't found where the slash conversion takes place ....
Found it!
In the function
Code:
function getMusicSharesSuccess(t) {
var responseArr = t.responseText.replace(/<html>/g, "");
responseArr = responseArr.replace(/<\/html>/g, "");
responseArr = responseArr.replace(/\n/g, '');
responseArr = responseArr.split("<li>");
for (var i = 0; i < responseArr.length; i++) {
if (responseArr[i] != "" && responseArr[i].length > 3) {
aContentPaths = responseArr[i].replace(new RegExp("/", "g"), "\\"); <<==== HERE!!
aContentPaths = aContentPaths.replace(/\n/g, '');
responseArr2 = aContentPaths.split(";");
........
Code:
aContentPaths = responseArr[i].replace(new RegExp("/", "g"), "\\");
aContentPaths = aContentPaths.replace(/\n/g, '');
Code:
aContentPaths = responseArr[i].replace(/\n/g, '');
The same patch works for video files, just must be applied to the function
Code:
function getVideoSharesSuccess(t)
-------------
EDIT: Patched script seems to work even in the Windows environment, as the path saved in the TreeNode object is allways in the native format (slashes for Linux, backslashes for Windows).
-------------
EDIT: Unfortunately the patch has a side effect - pointer to the played item in the playlist dismisses. Trying to solve.
-------------
EDIT: Problems if running both XBMC and XBMControl-web on the same Windows machine (loopback). This case music shares do not initialize properly (seems not related to the patch).