Listing addon files
#1
I'm wondering if anybody has a better idea on how to get a list of files for a web interface?

I wanted to find all the language files in my addons dir. I don't want to have to hard code it basically so atm I do a Files.GetDirectory on "special://home/addons/webinterface.awxi/lang".

I'm relying on the dir being "webinterface.awxi", which it should be but I thought someone might have a cleaner solution. Cool
Image
AWXi - Ajax web interface. Wiki
Reply
#2
Addons.GetAddonDetails should give you absolute path to the addon..
Code:
{'method': 'Addons.GetAddonDetails', 'id': 0, 'jsonrpc': '2.0', 'params'{'addonid': 'webinterface.awxi', 'properties': ['path']}}

Quote:{
"addon": {
"path": "/home/xbmc/.xbmc/addons/webinterface.awxi",
"type": "xbmc.gui.webinterface",
"addonid": "webinterface.awxi"
}
}


Either that or maybe you can make the webserver make a call to itself to get the language info from within?
EDIT: something like "http://127.0.0.1:8080/addons/webinterface.awxi/lang/en.xml"
Image
Reply
#3
Good shout. If they want to change the addonid then that's their lookout Smile

I can't get the list from the web server as browse is off and after some googling you can't get the file list of a dir on the web server with javascript etc. Tbh is wouldn't be difficult to make a lang list json file, just thinking if people want to create their own lang files they can just copy them over and they'll show.

Image
AWXi - Ajax web interface. Wiki
Reply

Logout Mark Read Team Forum Stats Members Help
Listing addon files0