Get Data from a Server (eg NAS)
#1
Hello
i am currently working on an addon where user can add his NAS Servers etc.

the Problem i am currently running in, is that i need to check if the server is reachable and has content
i dont see any documentation in the Kodi Docs to solve this, i decide to code an Ping method to check if the server is reachable, that shpuld work so far
now i am trying to get the content from the server. I have seen if i Activate a Window with the Buildin Command i can see the Content
(ActivateWindow(10002,protocol://ip ...) now my idea was to create an custom WindowXMLDialog which is dispalying the content in the <content> tag
this also works: $INFO[Window(Home).Property(ContentTag)] (i set the string in my addon)
but if i am now trying to fetch the data from the list:
eg the count
Control = self.getControl(9001)
size = Control.size()
the sze is always 0 , but in the Window i can see the content

any suggestions ?
Reply
#2
// sorry for double post

ive seen that there is an JSON-RPC method:

Files.GetDirectory

can i get the Content of the Nas with this method ? instead of an custom XMLWindow
Reply
#3
//
Files.GetDirectory isnt working
always returns an error:
{"error":{"code":-32602,"message":"Invalid params."},"id":1,"jsonrpc":"2.0"}

maybe because Milhouse said "If the path isn't in your sources.xml file, Kodi won't allow you to access it (for security reasons)."
(https://forum.kodi.tv/showthread.php?tid=313566)

any ideas ?
Reply
#4
Are you just trying to show a list of items in a directory?  If so you should look at the virtual file system calls:

https://codedocs.xyz/xbmc/xbmc/group__py...mcvfs.html

You would need to have a setting in your addon where the user selects the NAS using the Kodi browse UI (I do this with Artist Slideshow), and then you can use that as the "root" directory to display.  You'd still have to get each directory item from the list into a container of some sort to show, but it looks like you have that part figured out.
Reply

Logout Mark Read Team Forum Stats Members Help
Get Data from a Server (eg NAS)0