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 - Montellese - 2016-11-03

Maybe we are talking about different "api keys". In the Emby server management under "Advanced" there's a "Security" tab where I can generate a generic API key which gives me access to everything without having to log in. As it was the easiest thing to start with I used it to test manual API calls and also from Kodi's importer. Is this kind of API key not supposed to be used from the outside?


Media importing and library integration of UPnP - angelblue05 - 2016-11-03

Ah, I see what you are talking about. The api key generator under advanced is mostly for third party app that need to communicate with the Emby server (without using a specified user). It can also be used with any user Id to get user specific information from the server (useful for testing).

However, I would not depend on it for real application. You'll get a better reception if the user accessing his Emby account is authenticated once prior to being able to modify watched status, playback and such. That's just how every Emby apps operate.


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

Thanks. It was the easiest point to start but as mentioned before I've integrated user selection (or input for hidden users) and password authentication two days ago so I can probably get rid of the API key support and always rely on the access token provided after authorizing a specific user.


RE: Media importing and library integration of UPnP - Hedda - 2016-11-03

(2016-11-02, 12:43)Montellese Wrote:
(2016-11-02, 12:32)Hedda Wrote:
(2016-10-30, 19:35)Montellese Wrote: I have spent quite some time on supporting direct import from an Emby server through their API.

@Montellese, not sure if forbidden topic but this concept could also work great with Plex Media Server too right?

That is, code for Kodi that imports metadata from Plex's MediaServer API, maybe ported from PlexKodiConnect (or PleXBMC), rather than UPnP?

https://forums.plex.tv/discussion/210023/plexkodiconnect-let-kodi-talk-to-your-plex/ ( https://github.com/croneter/PlexKodiConnect )

http://forum.kodi.tv/showthread.php?tid=92310 ( https://github.com/hippojay/plugin.video.plexbmc )
I actually looked at Emby and Plex Media Server but the Emby API is much better documented with swagger-ui so trying it out and using it was much easier. Apart from some unofficial documents and the existing Kodi addons I couldn't find any information about the API of PMS. I did some "reverse engineering" and managed to login, retrieve movies, tvshows etc. which should be enough but those were only manual tests and I first want to get the Emby import working properly before looking at PMS again. But it's certainly possible.
Missed it before but looks like Davilla have already written a client for Plex for the McMC project, see:

https://github.com/MrMC/mrmc/tree/master/xbmc/services/plex

Perhaps that could be ported more easily then looking at the addons?


RE: Media importing and library integration of UPnP - cstmstyle - 2016-11-03

(2016-10-31, 16:01)LongMan Wrote: I have always followed the development. Media Import is perfect for Rear Entertainment Systems. I use it in my minivan. If everybody wants to watch the same thing, use the builtin system. If not, use your tablet, the same thing is available there. Significantly less bickering results. Big Grin

A manual sign in would be good. The Emby for Kodi addon works in a similar manner. After install it auto discover the server and walks through a wizard. Otherwise, one can sign in from the settings page which allows manual via username and password or EmbyConnect (allows sign without knowing the external ip address when away from home). And yes, it is a good idea to include password, many people in the Emby forums connect to their server outside of the home.

Could you outline your REAR ENTERTAINMENT SYSTEM or point me in the right direction on where this gets discussed in greater detail? I've wanted to setup something for a few years but most videos I see on YouTube tend to be a bit old.


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

(2016-11-03, 13:38)Hedda Wrote: Missed it before but looks like Davilla have already written a client for Plex for the McMC project, see:

https://github.com/MrMC/mrmc/tree/master/xbmc/services/plex

Perhaps that could be ported more easily then looking at the addons?

Yes I've been made aware of this as well this week. Thanks for pointing it out.


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

@cstmstyle. We are talking about entertainment for children/people in the rear seats of the van. My van has a built in system which i supplement.Provide some details on your situation and i will make some suggestions. I am looking to update mine too. So it should not be a problem.

Cheers,

LongMan


RE: Media importing and library integration of UPnP - cstmstyle - 2016-11-04

(2016-11-04, 01:01)LongMan Wrote: @cstmstyle. We are talking about entertainment for children/people in the rear seats of the van. My van has a built in system which i supplement.Provide some details on your situation and i will make some suggestions. I am looking to update mine too. So it should not be a problem.

Cheers,

LongMan


I don't want to get this thread off topic and may make a new one so the discussion can continue but basically I'm curious how others setup a system for their vehicle. I envision I would need a portable router with an attached drive for media storage. I'm looking to get a 2017 Toyota Highlander and I believe the entertainment package has HDMI input support. If so I would like to setup a Kodi mini pc plus have Tablet support if the kids want to watch things individually. It would be cool to sync it with my home Emby server.

I'm just diving into the world of Emby + Kodi and need to take time setting up Multi user Profiles and customize it to our needs.

Do you happen to have a video or pics of your current setup?


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

I, like you, do not want to high-jack the thread. If necessary, a Mod can move the posts.

It is a lot easier and cheaper than you might think. I have a router in my van now, I needed it when I first set it up, but you might not need one. I started with the original Raspberry Pi, however, with the RPi 3 you don't need a router, it can do minor routing too..

If the vehicle has an HDMI connection, you might only need to buy
  • Rpi 3 (Board, Case MicroSD card and Power Supply). Get a good power supply, it powers the flash drives as well so it needs to supply 2.5A
  • HDMI cable
  • micro flashdrives to store media.
  • Remote. Amazon Fire TV or Fire TV Stick remote will work with the bluetooth in the PRi 3. Later you can add game controllers if you want games (Retroplayer is in testing phase as well.)
  • Portable power pack. When the van is started it usually reboots the pi, waiting at a gas station or something like that. They don't like that, so I run the Pi from the power pack which is then connected to the power supply for recharging.
I started with XBMC shared via UPnP and when Media Import came last year (testing), i switched to that. Now you have choices. Just Kodi Media Import, LibreELEC with Emby server using either Emby for Kodi.

I don't have pics but when you are ready I will provide detailed instructions.

In terms of syncing to the home server, it was not possible at the time I started so didn't consider it. Emby for Kodi didn't even exist yet. My experience is that children watch the same show over and over again. I usually add new media to the van when they ask or if they are going on a trip.

Bear in mind that the OS for the PI is on the mSD card. One can easily swap the cards and the PI is now a computer, or Kodi with RetroPlayer. I have a card with Rasbian Jesse and a Keyboard and they also play MineCraft in the Back. As I said I will provide more details when you are ready.

Cheers,
LongMan


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

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 04 2016:
Changelog
  • Support user authentication against Emby server for both public and hidden accounts



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

I am giving it a test run right now. The manual login shows up and it is now registering a user with the server. With the previous build it didn't. At least there was no visible notification. It now shows User authenticated and the name of the device. It doesn't show (in the web client) what is playing, that may because you are no using HTTP..

After exiting and relaunching Kodi, I am getting Kodi has stopped working messages.

https://drive.google.com/file/d/0B-st1etAjqt5QlFwMjBXSkZkaXM/view?usp=sharing.

Cheers


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

(2016-11-05, 23:24)LongMan Wrote: I am giving it a test run right now. The manual login shows up and it is now registering a user with the server. With the previous build it didn't. At least there was no visible notification. It now shows User authenticated and the name of the device. It doesn't show (in the web client) what is playing, that may because you are no using HTTP..
Thanks for the feedback. Looks like that's working then.

(2016-11-05, 23:24)LongMan Wrote: After exiting and relaunching Kodi, I am getting Kodi has stopped working messages.

https://drive.google.com/file/d/0B-st1etAjqt5QlFwMjBXSkZkaXM/view?usp=sharing.
Does that mean that you can't launch Kodi anymore now? There is a know bug that Kodi sometimes crashes on shutdown when an import is still running because it cancels it without waiting for it to really stop. But that should not affect the next startup.


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

I can relaunch Kodi if I wait a minute or two. If I try immediately, it crashes. I was shutting down and deleting or rename myvideos108 to test the login. So it is partly due to my actions.

Interesting, the subtitles seem to be working. At least with the files I have tried so far.

Have you given any thought to how to separate the media libraries. I saw in an earlier reply to Angelblue, your explanation that media import will not try to repeat the experience from a native client but aims to integrate the items into the Kodi library.

All the back-ends have some separation, Emby, Plex, MeediOS, Media Portal 2. I suspect that users of the last 2 might want to add support for them because it would mean that they would have clients on all the platforms on which Kodi is present. I even used paths to separate in kodi, and I suspect others do too. Not being able to separate libraries will probably discourage some people from giving it a go.

One of the beauties of this approach is that as long as it is not randomly marking items as watched or unwatched or deleting them, it can easily be run along with a production system for more robust testing. Right now I am testing on an old laptop but if the LibreELEC version was out and i could separate the libraries, i would put it on a flashdrive, back up the database and run it for a day or two and see how it feels. Does the syncing process affect the user experience? How quickly does a new item get synced to the library etc. There are some things that are only noticed when it is compared to the normal experience.

Cheers,
LongMan


Update
Tested adding and removing libraries and in it each case it worked as expected. Add a library to server, synchronize client, items appear. Remove library, synchronize, items disappear. Tested for Movies, TV Shows and Music Videos. Items from other libraries of similar media type were not affected.

I did not see any import of collections (movie sets), i assume that has not been implemented yet.

A small suggestion, on the media sources settings screen, maybe you should just say TV Shows. From a Technical standpoint it is TV Shows, Seasons and Episodes, but from a user perspective, it just TV Shows, seasons and episodes are assumed to be there.

I cannot install any other skin, is that a problem with this build or a general Krypton problem?

All in all, Great Stuff.


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

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

(2016-11-06, 12:53)LongMan Wrote: Interesting, the subtitles seem to be working. At least with the files I have tried so far.
I didn't change anything Angel

(2016-11-06, 12:53)LongMan Wrote: Have you given any thought to how to separate the media libraries. I saw in an earlier reply to Angelblue, your explanation that media import will not try to repeat the experience from a native client but aims to integrate the items into the Kodi library.

All the back-ends have some separation, Emby, Plex, MeediOS, Media Portal 2. I suspect that users of the last 2 might want to add support for them because it would mean that they would have clients on all the platforms on which Kodi is present. I even used paths to separate in kodi, and I suspect others do too. Not being able to separate libraries will probably discourage some people from giving it a go.
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.

(2016-11-06, 12:53)LongMan Wrote: Does the syncing process affect the user experience? How quickly does a new item get synced to the library etc. There are some things that are only noticed when it is compared to the normal experience.
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.

(2016-11-06, 12:53)LongMan Wrote: I did not see any import of collections (movie sets), i assume that has not been implemented yet.
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.

(2016-11-06, 12:53)LongMan Wrote: A small suggestion, on the media sources settings screen, maybe you should just say TV Shows. From a Technical standpoint it is TV Shows, Seasons and Episodes, but from a user perspective, it just TV Shows, seasons and episodes are assumed to be there.
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.

(2016-11-06, 12:53)LongMan Wrote: I cannot install any other skin, is that a problem with this build or a general Krypton problem?
I haven't touched any of that code but who knows. I never tried it myself.


RE: Media importing and library integration of UPnP - Martijn - 2016-11-07

Skin not installing installing is a known issue. Should probably be fixed in current nightly version.


This forum uses Lukasz Tkacz MyBB addons.