Kodi Community Forum
WIP Media importing and library integration (UPnP, Emby, Plex, ...) - Printable Version

Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
--- Thread: WIP Media importing and library integration (UPnP, Emby, Plex, ...) (/showthread.php?tid=224794)



RE: Media importing and library integration of UPnP - LongMan - 2016-11-08

Montellese Wrote:First off, once again thanks for your detailed testing and feedback.

It is the least that I can do. I know that after some time of working alone on a big project, everything feels like it is running into each other. A fresh pair of eyes and a little feedback is a good way to break the monotony. So no problem.

Montellese Wrote:The problem is that Kodi does not really support this at all right now. You have to use hacks like smartplaylists etc. to get this kind of separation. This makes it almost impossible for media importing to support it in a useful way. From what I understood Emby solves this by using tags? Those can be (and probably are being) imported so you could still create smartplaylists in Kodi.

Yes, Emby for Kodi (E4K) does use tags. But not the tags that are stored on the server. The tags on the server are being imported in the current build. The tags used for library separation are added while the item is being imported. The logic goes something like this
  • E4K asks the server for all the media libraries of a certain media type, say movies.
  • These are returned, (Movies, Kids Movies and Documentaries in my case)
  • It takes each in turn and ask for the media item within that library (SELECT * Kids Movies).
  • These are returned, it loops through them, as it loops through the items it tags each one with the name of the library, Kids Movies, and add it to Kodi.
  • it then move to the next library of the same media type and repeat the process. Then on to another media type etc.

It is true that Kodi does not support it. I was hoping that you could put a strut in place so that when Kodi actually supports it, the addons will not have to be modified. By this I mean put an external interface for it, maybe just a property/method in the code, and then use whatever 'hacks" inside the function in the importer. You could follow Emby for now and use tags. In doing this the addons would be passing in the information through one uniform interface. When Kodi properly supports it, the internal code could be changed, in one place, and the 'addons' would be none the wiser. I suspect if you do not define such an interface there are going to be many hacks. Thinking about it, the hacks may offer alternate approaches to a solution. However, it might be safer to limit the chaos.

Montellese Wrote:Right now it only syncs when it detects the media provider and after that through manual syncing. But that's just because I haven't implemented the websocket stuff which would inform Kodi's importer as soon as something has changed in Emby. Syncing watched state from Kodi back to Emby should be instantaneous.

I was wondering how I could test that since I had only one client, forgot that I can use the Emby Web Client. I will check that.

Montellese Wrote:Collections seem to be handled differently in Emby than I expected. You don't get the collections a movie belongs to as part of the movie's metadata (is there a reason for this or did I just miss some property?). You have to ask for all collections separately and I haven't implemented that yet.

That's right. Collections are handled separately in Emby. It is in a section by itself. The approach to closer to what you had envisaged for tags, but the addon imports it as Movie Sets. I like that actually. I have only made one personal collection, the others are from the scrapers, but I appreciate the flexibility. There is a separate import for collections in the Emby for Kodi addon. It runs right after all the movie libraries have been imported. Just a heads up, it does not have a web socket event for changes yet. There are many request for it to be added.

Montellese Wrote:I've thought about this too and it's probably the better thing to do but I'll have to see how I integrate it in the generic (i.e. media type agnostic) implementation of the media importer.

Cool


LongMan


RE: Media importing and library integration of UPnP - LongMan - 2016-11-08

(2016-11-07, 11:26)Martijn Wrote: Skin not installing installing is a known issue. Should probably be fixed in current nightly version.

Martijn, thanks for the update. Hopefully it will be included in the next build.


RE: Media importing and library integration of UPnP - xnappo - 2016-11-13

Montellese,

Nice work so far!

Couple of questions (sorry if you already answered):

- How can the 'device has been off' situation be handled without a full re-sync? Emby provides a hook for sending data changes since time 'x' via the EmbySync plugin - will that be of use?
- Long-term - how do you see development of the importers being handled? Are they separate from the Kodi core such that they can be developed/maintained as a type of 'addon' like the Python addons and TV backends?

Thanks!
xnappo


RE: Media importing and library integration of UPnP - Montellese - 2016-11-13

(2016-11-13, 00:30)xnappo Wrote: - How can the 'device has been off' situation be handled without a full re-sync? Emby provides a hook for sending data changes since time 'x' via the EmbySync plugin - will that be of use?
Right now it's doing a full sync but the whole system can handle partial updates just fine.

(2016-11-13, 00:30)xnappo Wrote: - Long-term - how do you see development of the importers being handled? Are they separate from the Kodi core such that they can be developed/maintained as a type of 'addon' like the Python addons and TV backends?

Right now both importers are part of the Kodi source code and the UPnP one will probably stay that way because it depends on Kodi's UPnP implementation. But the Emby importer could be turned into a binary addon or even into a python addon. But I haven't written the necessary interfaces for those cases yet. Everything around media importing is already done through interfaces so it shouldn't be that difficult.


RE: Media importing and library integration of UPnP - cscott1 - 2016-11-15

I apologize if this has been addressed I didn't read all 16 pages of this thread. I read the first page on the description of this Kodi service or build but I'm unsure whether this build will accomplish what I am wishing to do which is to use the default select action of show information over a UPnP path. I'm currently Using Jarvis 16.1 I set both my windows server and my mxq pro Android box video settings in file lists for the default select action to show information. It works for library files on each device however when I select the file from my server through the UPnP path on my Android box it starts playing the video file instead of going to the information page. I would like to read the synopsis and watch the trailer and what not before watching the video. Does this build support this? If not I would like to request support for that feature.


RE: Media importing and library integration of UPnP - LongMan - 2016-11-15

@cscott1

That is a feature of Kodi so it should work. However, testing it with my Emby Server, I am getting mixed results. I have not set up a Kodi UPnP Server for this build yet, I am waiting for the LibreELEC Builds.

With Emby, it works as expected from within the library views, however it crashes from the Home Screen Widgets. Montellesse has the Widgets on his review list, so I expect that to be dealt with when he gets there.

Hope that helps.

LongMan

BTW, I have the old Jarvis builds in the van, I will check the UPnP when i go out later today. Remember this is the old one year old version, so it doesn't guarantee anything


RE: Media importing and library integration of UPnP - cscott1 - 2016-11-15

@LongMan thanks for the response and testing for me.


RE: Media importing and library integration of UPnP - Montellese - 2016-11-15

(2016-11-15, 16:50)cscott1 Wrote: I apologize if this has been addressed I didn't read all 16 pages of this thread. I read the first page on the description of this Kodi service or build but I'm unsure whether this build will accomplish what I am wishing to do which is to use the default select action of show information over a UPnP path. I'm currently Using Jarvis 16.1 I set both my windows server and my mxq pro Android box video settings in file lists for the default select action to show information. It works for library files on each device however when I select the file from my server through the UPnP path on my Android box it starts playing the video file instead of going to the information page. I would like to read the synopsis and watch the trailer and what not before watching the video. Does this build support this? If not I would like to request support for that feature.

Kodi doesn't allow this on purpose right now because the info dialog also allows you to do stuff like refreshing the item, choosing different artwork etc. which is not possible for remote (UPnP) items. With my work this becomes possible for all items imported into the library but if you e.g. choose new artwork for an item imported from a UPnP server that information is not passed on to the UPnP server yet so it's only a local change.


RE: Media importing and library integration of UPnP - cscott1 - 2016-11-15

Ok great I'll load your build then give it a go. Thank you for your work and development in this it's much appreciated.


RE: Media importing and library integration (UPnP, Emby, ...) - Montellese - 2016-11-16

Unfortunately the win32 jenkins slave is having problems right now so I wasn't able to make it build a win32 release of the latest updates. It will follow as soon as jenkins has been fixed.

These builds are based on the Kodi Krypton Betas and not on Kodi Jarvis

If you ran a previous version of this test build you need to delete your MyVideosXX.db

Latest test builds: November 15 2016:
Changelog
  • Rebased onto Krypton Beta: https://github.com/xbmc/xbmc/commit/e9c91bf5357c870d27068445fa0fe7c6165f5deb
  • Reworked media import settings to use the same underlying system as media provider settings.
  • Added a new category to media import settings for Emby which support choosing the libraries/views to import.
  • Extended the emby media importer to add the library/view an item belongs to as a tag.



RE: Media importing and library integration (UPnP, Emby, ...) - LongMan - 2016-11-16

@Montellese @Milhouse.

Any Chance of LibreELEC builds. It would be greatly appreciated. It is much easier to test by replacing a mSD card or flashdrive and not using production system. Can then see what happens across clients.

Cheers,
LongMan


RE: Media importing and library integration (UPnP, Emby, ...) - Montellese - 2016-11-16

(2016-11-16, 18:25)LongMan Wrote: @Montellese @Milhouse.

Any Chance of LibreELEC builds. It would be greatly appreciated. It is much easier to test by replacing a mSD card or flashdrive and not using production system. Can then see what happens across clients.

Cheers,
LongMan

Unfortunately I neither have the infrastructure nor the knowledge to provide LibreELEC builds so you have to hope for Milhouse to have the time and energy.


RE: Media importing and library integration (UPnP, Emby, ...) - LongMan - 2016-11-17

So We live in hope.


RE: Media importing and library integration (UPnP, Emby, ...) - Milhouse - 2016-11-17

This branch doesn't build on Linux: http://sprunge.us/RIhH


RE: Media importing and library integration (UPnP, Emby, ...) - Montellese - 2016-11-17

@Milhouse: thanks for the feedback. Oddly enough it built fine on all platforms (linux, rpi, osx, ios and android) on jenkins...


This forum uses Lukasz Tkacz MyBB addons.