Emby for Kodi / JSON-RPC / Alternate back end
#31
Well yes WAL does not work over network so deal breaker Sad
Reply
#32
Is it possible to offer JSON-RPC access as an alternative connection so it can go into the official repo.

At least then if devs can see how slow it is, they might be encouraged to look for solutions.
Reply
#33
Well, the #1 problem is you cannot do an 'add' with JSON-RPC - we were doing a nasty hack with getting around this with fake .strm files in our early versions, but that was really slow too.

null_pointer is extending JSON-RPC to include the features we need, at least for movies, then we will publish a test case. My gut feeling is it will be do-able to get it acceptably fast - then it will just be a matter of getting the pull request accepted.

If someone really wants to see the difference, you can go back to our initial release using JSON-RPC and see - but I don't really think there is much point to be honest.

xnappo
Reply
#34
Glad to hear it, There's nothing like having a real world speed test and comparison to get developers interested.
Reply
#35
(2015-09-18, 14:41)xnappo Wrote: Well, the #1 problem is you cannot do an 'add' with JSON-RPC

I'm not a dev so dunno if this would have been a help, unfortunately from my understanding topfs2 is taking a break from Kodi stuff hence why it's closed.

https://github.com/xbmc/xbmc/pull/5484
Reply
#36
already posted that PR Wink



(2015-09-18, 14:00)zag Wrote: Is it possible to offer JSON-RPC access as an alternative connection so it can go into the official repo.

At least then if devs can see how slow it is, they might be encouraged to look for solutions.
It was already known that JSON-RPC has a bottleneck somewhere however it takes a lot of time of some dev to look where that bottleneck is.
So doing above wouldn't really make any difference as you still need some one to invest time.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#37
Yes, that PR isn't exactly what we needed anyway. I'll be helping null_pointer with the test case this weekend - we'll see how far we get. Note that we aren't going to publish the test case and say 'okay, now go fix it' - we intend to help with optimization.

xnappo
Reply
#38
Montellese, if you are interested in discussing how your DB import stuff might work - here is the raw Emby JSON data we have to get in the DB:

https://github.com/faush01/plugin.video..../items.txt

null_pointer is making good progress with the JSON-RPC improvements route, but good to discuss all options.

xnappo
Reply
#39
it looks like writing to the DB is slow, I will look further when I have finished the last two endpoints (seasons and episodes) as to why it might be slow.

I initially though the slowness was due to opening and closing DB connections and it still might be but actually writing to the DB is a little slow, we are using transactions in a few places, this might be one cause, will need to investigate.
Reply
#40
Hi guys,

Pardon the intrusion. I am trying to help out with the CinemaVision add-on by putting some actions together to share with the masses.
I have been running into issues which, at this time, I attribute to lack of understanding of the inner workings.

The actions seem to take JSON, but it doesn't quite behave the way you'd think and my REST calls are failing.

Is there a place where I could look at API docs or something similar for these scripts so I can understand them better?
Intel Core i7 3.3Ghz | GTX 1660 | Windows 1909 | 8GB | 32TB RAID1
138" 2.35:1 Elite Lunette Curved Screen | Epson 6050ub Projector | Marantz SR-6014 | Emotiva XPA-11
Reply
#41
(2015-09-20, 20:25)xnappo Wrote: Montellese, if you are interested in discussing how your DB import stuff might work - here is the raw Emby JSON data we have to get in the DB:

https://github.com/faush01/plugin.video..../items.txt

null_pointer is making good progress with the JSON-RPC improvements route, but good to discuss all options.

xnappo

Thanks for the API output. I've taken a quick look and it should be pretty simply to translate that into our internal item representation. The way my media import works is that it supports different importers (right now there's only an implementation for UPnP) which get a list of previously imported items and can then do whatever they have to to import items. They can then specify whether they can determine the changeset between the previously imported items and the newly imported items themselves (for approaches where only the changeset is retrieved) or they can leave the task up to a generic implementation which compares all the properties of all the previously and newly imported items.

I have no idea how your API works but the simplest approach would probably be to call the API endpoint that returns e.g. all movies, translate the result into kodi's internal item representation and then simply pass that on to the rest of the import procedure.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#42
Hi Montellese - that sounds a lot like what we have implemented in the addon, so this is definitely worth pursuing in parallel to null_pointer's investigations. We initially query for all the data, then receive change sets from there on out.

We already have a translation layer between the Emby API and Kodi API in Python of course.

Can you point me to the UPnP importer?

xnappo
Reply
#43
@xnappo: You can find more information about my work in the test thread at http://forum.kodi.tv/showthread.php?tid=224794. The github branch of my work is https://github.com/Montellese/xbmc/tree/media_import. The UPnP importer is located at xbmc/network/upnp/UPnPMediaImporter.h/.cpp but it doesn't contain all that much logic because it makes use of the existing UPnP integration in Kodi so all the UPnP DIDL to Kodi media item representation logic exists in the UPnP integration code and not specifically in the importer. The importer translates the media type to be imported into a proper UPnP item class and makes a search request to the UPnP server for that specific item class and then translates the result into Kodi media items and passes them on to the rest of the import process (which is pretty generic).

The API also supports updating single items so if the UPnP server announces an update of a specific item (which Kodi can't do right now but it's possible in the UPnP specification) it could update that specific item's details.

How do you handle playback in the existing addon? Do you try to play a direct file URL (samba, NFS or whatever) or does Emby Server provide a stream/file access API?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#44
Hi Montellese,

We actually offer two playback methods. In the first we populate the path with a plugin link with a 'play' argument - this is needed for things like transcoding when remote. The second method we just populate the direct path - this is mostly just used for very low end devices like the original Pi where just launching an addon at all is a little laggy.

So do you definitely see these importers as being C code compiled into the Kodi source?

xnappo
Reply
#45
Not necessarily in the Kodi source and also not necessarily in C/C++ but for now it was easiest to make use of the existing UPnP functionality in Kodi which is written in C++. I plan to turn importers into binary addons so that they can be developed outside of Kodi's source if necessary. Adding a bridge for python addons could be a possibility as well.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply

Logout Mark Read Team Forum Stats Members Help
Emby for Kodi / JSON-RPC / Alternate back end0