NextPVR Forums

Full Version: LivePvrData.dll
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Would like to get some information on how to use this DLL or the website that supplies the data. I'm looking to use Powershell and see what I can do with extending the recording time of live TV. Also, I would also like to find out how NextEnd tells NextPVR to extend the stop time.

Can someone help?

Thank you.
As a bit of background LivePVRData.dll is a .NET dll that a SageTV developer Slugger wrote for me several years ago that allowed NextEnd to connect to the remote server he was running for SageTV users of his Sports Extending plugin SRE https://forums.sagetv.com/forums/showthread.php?t=57364

Slugger dropped support for SRE a while back and it was picked up by another SageTV users skiingwiz but their web server was never brought back on line. Each users runs a local web server to get the date. I decided for NextPVR that I would could run a linux cloud VM to support the few NextEnd users since it only costs me about $3 a month.

The source code for the server and the client dll are maintained here https://github.com/livepvrdata-oss

In theory the server can extend any program but in reality it would need to know how to do this. For sports it is simple as there are APi's and web sites to scrap that help determine when the shows end. The lenghs of most other delays caused by news, weather, politicans etc are much harder to figure out from a known web site, probably a waste of time even trying.

From NextEnd's perspective. I determine when the sports program is just about to end and keep bumping it until the server and DLL return that it stopped. For extending non sports, I check the ending time of sports that proceed any show following on the same channel that you are recording and if the sport goes over the expected end time all subsequent shows are extended by the same amount plus some buffer to allow for the sports wrap up.


Martin
Many thanks, Martin. Your reply was very informative. I'm not sure where I can go with this information but I will certainly dig in and take a look. If I see something, I'll say something although I not really sure what I'm looking for. It seems NextEnd has everything covered.

I think what I'm asking is what seems to "break" NextEnd most often. May I can start looking there.

Thanks, again.
The main things that break are on the remote server including

- API changes for matching. NASCAR changed 3 times since I started but it seems to be generic now.
- Sports team names not being matched via the subtitle data in the EPG
- ESPN web site slow to update end of event. SD is worse

Logic wise

- rain delays and cancellations cause in predictable results.
- guessing how much post game chat to add to the recording.

Martin
Good tips, Martin. Thanks.

JohnC
Hello...It's been awhile.Smile

I've been having no luck on how to use livepvrdata.dll. Is there a wiki page somewhere? Believe me, I've tried all I know to find it but I always come up snake eyes.Sad

Could you please maybe tell me where I can find the information I need to use the .dll and how to alter npvr.db3 to extend the recording time? Maybe a code snippet?:o

Thanks.

JohnC
Sorry the dll basically just provides the status of event based on the guide data in NextPVR that is title subtitle and start time so the sniipet I use is

Code:
Client clnt = new Client(myUri);
                Response resp = null;
                resp = clnt.GetStatus(game.Title.Replace("Preseason ", ""), game.Subtitle, game.StartTime);

It is up to you to process the http errors, and the returned Response object. After that there are threads to sleep th process until the appropraite time etc and then I basically use the NextPVR api to extend a running recording

Code:
IScheduleHelper helper = null;

                    if (ScheduleHelperFactory.GetScheduleHelper() == null)
                   {
                       RecordingServiceProxy.ForceRemote();
                       ScheduleHelperFactory.SetScheduleHelper(RecordingServiceProxy.GetInstance());
                       PluginRegistry.GetInstance().LoadPlugins();
                   }
                   helper = ScheduleHelperFactory.GetScheduleHelper();
....
                    ScheduledRecording curSchd = ScheduledRecording.LoadByOID(schd.OID);

....  calculate the new end time and update curSchd

                    curSched.EndTime = xxx;
                    curSchd.Save();
                    helper.ReloadSchedule();

That's about all that I am willing to provide to support this

Remember to if you have read the source listing I provided earlier you will need to run a jetty web server to run the livepvrhost server software that you will be makes calls too. My server for NextEnd is not for other uses.

Martin
Many thanks, Martin. The code snippets will help unravel the source code I downloaded from GitHub.

Keeping your server private is understandable. Does the jetty server software know how to keep the database updated or will the source code have that info?
Those snippets are really for your code, probably won't help much with the github source. The jetty server has no idea about NextPVR or it's database, it simply scraps some sites for the status of the game, you need to call the server and decide if you need to update the server.

Martin