Jump to content

VDR plugin development


Tuxx

Recommended Posts

hoppel118

@@domenic

 

Maybe its better to use vdr-plugin-vsniserver instead of vdr-plugin-restfulapi to get the complete epg-data?

 

Is it too much work to rewrite the emby-vdr-addon? The vnsi-plugin/-addon provides the epg-data to kodi very well.

 

What do you think about this?

 

vnsi is managed by @FernetMenta at github who is also present in the kodi forum.

 

Greetings Hoppel

Link to comment
Share on other sites

domenic

I use that plugin with Kodi and it dies work very well. Based on my testing I believe there is some bad data or missing information stopping the data from being accepted by Emby. The restful api is producing the information just fine, the issue is in the population of the data into Emby.

Link to comment
Share on other sites

Hello,

 

I think it's time to add my observations. I also started a few day ago to write my own vdr livetv plugin (with help of the existing one). I had two problems:

1) The order of the channels was mixed: I found out that it should be fixed in the current dev version, but wasn't able to test it yet.

2) For some channels the Guid isn't imported correctly. I debugged the channel that has obviously no guide data and found out that restful-api delivers the correct data, but they are somehow not accepted/Saved by emby.

 

The next step I want to take is debugging emby, to find out what's the problem with the data. I think tomorrow evening I will have some hours to spend, but maybe the problem is solved then already :-)

 

Regards,

Jack

  • Like 1
Link to comment
Share on other sites

domenic

cool that you were able to update the old git code to support the new plugin requirements.

 

Do you have the code on git? The new version is a rewrite based off the NextPVR, and does work with the new Envy, I will post the new released code later today.

  • Like 1
Link to comment
Share on other sites

hoppel118

It would be great, if you could work together, to get the epg data issue solved.

Edited by hoppel118
Link to comment
Share on other sites

domenic

Hello,

 

I think it's time to add my observations. I also started a few day ago to write my own vdr livetv plugin (with help of the existing one). I had two problems:

1) The order of the channels was mixed: I found out that it should be fixed in the current dev version, but wasn't able to test it yet.

2) For some channels the Guid isn't imported correctly. I debugged the channel that has obviously no guide data and found out that restful-api delivers the correct data, but they are somehow not accepted/Saved by emby.

 

The next step I want to take is debugging emby, to find out what's the problem with the data. I think tomorrow evening I will have some hours to spend, but maybe the problem is solved then already :-)

 

Regards,

Jack

 

This is an example channel:

{"name":"VuODF1","number":2113,"channel_id":"S91.0W-256-5-1799","image":false,"group":"","transponder":212282,"stream":"S91.0W-256-5-1799.ts","is_atsc":false,"is_cable":false,"is_terr":false,"is_sat":true,"is_radio":false,"index":1118}

We match the channel_id to the value Id in Emby, so Id is the GUID?   When we create the ProgramInfo record, we pass the channelId to the call, so these two will definitely match.  How did you query the ProgramInfo to find the matching Id and channelId?

 

Domenic

Link to comment
Share on other sites

 

 

2) For some channels the Guid isn't imported correctly. I debugged the channel that has obviously no guide data and found out that restful-api delivers the correct data, but they are somehow not accepted/Saved by emby.

Sorry... I meant guide data (epg), nothing with GUID. Sorry for the missunderstanding.

 

Here is my Git repo. But not everything comitted yet.

https://github.com/Jack187/Emby.Plugins

 

At the moment there is no streaming possible. I concentrate first on getting channels, egp data, recordings and timers.

 

Today I won't be able to do much, but hopefully tomorrow evening.

 

Good Night

Link to comment
Share on other sites

Ok...  I couldn't resist. I just wanted to setup debug environment, but as I was able to debug emby I started to look for the "GetProgramsAsync" call.

 

It is a bit hard for me to follow the implemenation, but I saw that a channel that has problems with showing epg in web view gets the correct ProgramInfo from Plugin.

 

But then I noticed that everytime when I refreshed the guide I always have many "newPrograms". Somehow they are not saved into DB I guess. But here I need some help what to check next.

There is a CleanupDBinternal method where some itemIds seem to be removed, but uncommenting this part for testing didn't solve the issue.

 

I attached a small screenshot of my debug session. @@Luke, maybe it helps and you can point in the right direction. 

One more thing: the first item in the updatedPrograms collection is the one that is displayed in webview as first item (but I think thats obvious).

 

 

587ff5c98b0de_Clipboard01.jpg

Regards,

Jack

Edited by Jack187
Link to comment
Share on other sites

domenic

See if they are erroneously being deleted.

As a test, if we were to just do a complete full refresh every time and ignore the fact that some are new and some are updates, this would verify all the data is being stored.   If we still have missing information then there is another issue going on.

Link to comment
Share on other sites

domenic

The other thing is make sure all programs have unique id's.

Ok I fixed my copy!   Just add the channel to the id string like so:

            if (root != null && root.events != null)
            {
                return root.events.Select(epg => new ProgramInfo()
                {
                ChannelId = channelId,
                Id = epg.channel + epg.id.ToString(),
   

and now I get a full guide.

 

Domenic

  • Like 1
Link to comment
Share on other sites

domenic

This will likely be the last version that I post, as it appears that Jack has an actual Programing Environment (I am just attempting to get this to work from my Linux Server on the command line!).  I pass the torch onto his shoulders.  Thanks for taking this on Jack!  Note my version only displays the Guide and will playback content, I have not worked on expanding to timers and such.

 

Domenic

 

 

MediaBrowser.Plugins.VDR.0.4.3.zip

  • Like 1
Link to comment
Share on other sites

domenic

Sorry... I meant guide data (epg), nothing with GUID. Sorry for the missunderstanding.

 

Here is my Git repo. But not everything comitted yet.

https://github.com/Jack187/Emby.Plugins

 

 

Jack you may want to work with the new repo I have, if you note in this thread the newer version of Emby will not work with the old code as it includes external libraries which is no longer allowed.

 

Domenic

  • Like 1
Link to comment
Share on other sites

Oh... much going on here :-)

 

I just stopped debugging a few minutes ago:

 

I found out that i got lets say 250 new ProgramInfo dates for Channel A:

After 

await _libraryManager.CreateItems(newPrograms, cancellationToken).ConfigureAwait(false);

I fired an InternalsItemQuery to check if the ProgramInfo was saved. It was.

 

Then I found out that with one special channel I got also aound 250 new ProgramInfos. But after the _libraryManager.CreateItems call my previously saved ProgramInfo (from Channel A) were gone (checked It every time after CreateItems with an InternalsItemQuery.

 

Because other channels were working flawlessly with new ProgramInfo (mostly only 2-20) I saved all added IDs (then ones deliver from my plugin via vdr-RESTfulapi plugin.

And here I found the issue. IDs were not unique!

 

To ensure that I verfified that with vdr RESTful api:

JSON quey with channel S19.2E-1-1019-10304:
....
{"id":58691,"title":"Die Liebe ein Traum","short_text":"Fernsehfilm Deutschland 2008","description":"Kein Zweifel: Die attraktive Japanologie-Studentin Anna und der angehende Architekt Max sind f\u00fcreinander bestimmt. Doch ihre Liebe steht unter keinem g\u00fcnstigen Stern. Als Anna ein einj\u00e4hriges Stipendium in Japan erh\u00e4lt, entscheidet sie sich f\u00fcr ihre Karriere und gegen eine feste Bindung. Max ist zutiefst entt\u00e4uscht und versucht Anna zu vergessen. F\u00fcnf Jahre sp\u00e4ter treffen die beiden sich wieder.\nProduziert in HD","start_time":1485198900,"channel":"S19.2E-1-1019-10304","channel_name":"SWR RP HD","duration":5400,"table_id":81,"version":21,"images":0,"timer_exists":false,"timer_active":false,"timer_id":"","parental_rating":0,"vps":1485198900,"components":[{"stream":5,"type":11,"language":"deu","description":"HD-Video"},{"stream":2,"type":3,"language":"deu","description":"stereo"},{"stream":4,"type":66,"language":"deu","description":"Dolby Digital 2.0"},{"stream":3,"type":1,"language":"deu","description":""},{"stream":2,"type":3,"language":"deu","description":"ohne Audiodeskription"},{"stream":3,"type":32,"language":"deu","description":"DVB-Untertitel"}],"contents":[],"raw_contents":[],"details":[],"additional_media":null}
...

 

 

 
 
JSON quey with channel S19.2E-1-1019-10301:
...
{"id":58691,"title":"Dimitrios Schulze","short_text":"Spielfilm Deutschland 2016","description":"","start_time":1486079400,"channel":"S19.2E-1-1019-10301","channel_name":"Das Erste HD","duration":5580,"table_id":83,"version":22,"images":0,"timer_exists":false,"timer_active":false,"timer_id":"","parental_rating":0,"vps":1486079400,"components":[{"stream":5,"type":11,"language":"deu","description":"HD-Video"},{"stream":2,"type":72,"language":"deu","description":"mit Audiodeskription"},{"stream":3,"type":32,"language":"deu","description":"DVB-Untertitel"}],"contents":[],"raw_contents":[],"details":[],"additional_media":null},
...

 

 

 

So it's not an emby bug I would say. But maybe emby could provide a log message, or what dou you think @@Luke?

 

 

@domenic:

Cool that you already posted the solution :-)... with your modified ID they are unique now

Edited by Jack187
  • Like 1
Link to comment
Share on other sites

 

Jack187, on 18 Jan 2017 - 9:54 PM, said:

snapback.png

Sorry... I meant guide data (epg), nothing with GUID. Sorry for the missunderstanding.

 

Here is my Git repo. But not everything comitted yet.

https://github.com/J...87/Emby.Plugins

 

Jack you may want to work with the new repo I have, if you note in this thread the newer version of Emby will not work with the old code as it includes external libraries which is no longer allowed.

 

Domenic 

 

I started from scratch to learn a bit more, but had a look with one eys at the old plugin to see how the objects are to be filled.

So i started directly based on the current guide how to create a protable plugin (no external libraries)

 

I think I will bring my plugin to the end. It's fun. But I would feel bad if you stop now. Maybe there are some other problems coming where we can support each other?

 

Have a nice day, guys! I needto go to bed 1:48 am :o

Jack

  • Like 1
Link to comment
Share on other sites

domenic

I have forked the latest of jack's code and updated it to include play back of live streams and recordings, as well as some "North American" tweaks to the Scraping of the Guide data.  attached is the working zip file.

 

Domenic

LiveTv.vdr.zip

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...