![]() |
|
|||
|
Beyond TV SDK addition for developers (BTV >= 4.8)
This is an update to DaWanderer's Beyond TV SDK addition for developers.
- Version 4.81 requires Beyond TV 4.8 or later and .Net Framework 2.0 (it is not backward compatible). - Version 4.9 requires Beyond TV 4.9 or later and .Net Framework 3.5 (it is not backward compatible). Motivation: Starting with BTV 4.8, SnapStream introduced multiple security levels. Accordingly, the BTV API had to be modified to make use of those security levels, otherwise any BTV addons would always be executed with administrator rights. Practically, this means that the new logon method is: PVSPropertyBag bag = BTVLicenseManager.Logon(networkLicense, username, password); so you now need to provide a username (i.e. administrator). It now returns a property bag with two properties, "UserID" and "AuthTicket" (a blank username also works, but it will not return a UserID). The "AuthTicket" property will be required by every web service calls after this, and it is used to identify your client's session. bool isRenewed = BTVLicenseManager.RenewLogon(AuthTicket); Sends a keep alive to the authentication manager. Resets the 15 minute timeout period for the given authorization ticket. Changes to PropertyBagHelper: - In the previous version, the PropertyBagHelper inherited from ICollection, while this one inherits from a generic list of PVSProperty (List<PVSProperty>). - Only one PropertyValue can be associated with one PropertyName (a few methods dealing with multiple values have been removed). - When creating a "new PropertyBagHelper(PVSPropertyBag)", the PVSPropertyName with a blank PVSPropertyValue will not be added. - When creating a "new PropertyBagHelper(PVSPropertyBag)", a renormalization is performed to use some more generic PVSPropertyName. SearchDisplayTitle and SeriesDisplayTitle are assigned to DisplayTitle, SeriesDescription and EpisodeDescription are assigned to Description, TargetDuration is assigned to Duration, TargetStart is assigned to Start, TMSChannel is assigned to Channel. A DisplayedChannelID is also added (if missing) when setting up a Channel. It makes it easier to perform operations on a PropertyBagHelper without having to consider which method produced it. - There is one way to bypass the two previous points, use bagHelper.Add(PVSProperty), this will not renormalize the PVSPropertyName and will accept an empty PVSPropertyValue. - IsOverLapping(bagHelper) compares the Start and Duration of both PropertyBagHelper to see if they overlap. - GenericID() will return the EPGID with the last four digits set to 0. Generic episodes are actually showing up like that. Added a SuperBags class: - This new class is a generic list of PropertyBagHelper (List<PropertyBagHelper>) with a few extra methods. - ToPropertyBags() will convert an instance of that class, so you can feed it back as a parameter of a BTV API method. - IndexOf() (and its overloads) makes it possible to find the Index of the PropertyBagHelper containing a specific PVSPropertyName, PVSPropertyValue pair. Special property names are recognized: GenericID will compare both GenericID, GenericID- will compare both Generic while skipping the first two characters (sometimes EP or SH can be used on the same series) and finally "FULL" will compare the EPGID, Start and UniqueChannelID (which should be enough to confirm you are dealing with the same show). - Contains() is based on IndexOf() but will simply return a true or false value. - Helper() is based on IndexOf() and will return the actual PropertyBagHelper of that match. - ShowInConflict(bagHelper) will return the DisplayTitle of the first show with a positive IsOverLapping(bagHelper). You could use this, for example, to find out if it is safe to reboot the PC, by checking that no upcoming recordings are within the next 10 minutes... - Sort(property, order {, IsANumber}) will sort the SuperBags for one property. When sorting by something like the channels, use IsANumber = true (otherwise just omit it). - GetSortType() returns the current property and order used to sort the SuperBags. - FromChannelXML(textXML) fills the SuperBags from a list of channels (i.e. from GetUserChannels).
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. Last edited by Fonceur; 12-27-2008 at 01:16 PM. |
|
|||
|
Re : Beyond TV SDK addition for developers (BTV >= 4.8)
Updated to version 2.
Trying to use bagHelper.Remove("PropertyName"), without checking for the existence of PropertyName in the first place, was a bad idea...
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Beyond TV SDK addition for developers (BTV >= 4.8)
First - thanks for the work. Saves time. Caveats follow.
R.E. prop bag that overwrites duplicate properties: Hmmm... that sounds like a dictionary to me. The service calls return an untyped prop bag with possible duplicates. Seems to me that to hide information returned from the service is doing a disservice to the consumer. If you would like to modify the data coming from the service perhaps a new class, e.g. PropDictionary, would be appropriate. If you do not agree I will be branching BTVLibrary as I DO want to know EXACTLY what the service is returning. best regards, sky |
|
|||
|
Quote:
Quote:
PropertyBagHelper bagHelper = new PropertyBagHelper(pvsBag); just use: PropertyBagHelper bagHelper = NewBagHelper(pvsBag); with: Code:
public PropertyBagHelper NewBagHelper(PVSPropertyBag pvsBag)
{
PropertyBagHelper bagHelper = new PropertyBagHelper();
Foreach (PVSProperty prop in pvsBag) bagHelper.Add(prop);
Return BagHelper;
}
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Beyond TV SDK addition for developers (BTV >= 4.8)
There won't be duplicate property names coming from any of the webservices.
|
|
|||
|
Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Thanks for confirming that.
I have built a logging adapter layer for my service proxy assembly that logs all property bags coming out of the webservices. This is allowing me to infer possible property results for each service call and generate stongly typed domain object wrappers. Seems to be working out just fine so far. Once I finalize the architecture of my api I will make my lib play nice with the others out there. |
|
|||
|
Re: Beyond TV SDK addition for developers (BTV >= 4.8)
I have found an issue with the latest version of the BTVLibrary and BTV 4.9.0. After upgrading BTV, AddBlockedRecordings causes a crash with the following information:
Code:
Unhandled Exception: System.Net.WebException: The request failed with HTTP status 400: Bad Request. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at BeyondTVLibrary.BTVScheduler.AddBlockedRecordings(String authTicket, PVSPropertyBag[] bags) at BTVRecMgrConsole.Program.Main(String[] args) |
|
|||
|
Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
I just blocked a recording in BTV-Negociator without any issue... Are you sure that it's not the ticket that had expired?
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Quote:
In your program, when you block a recording, are you doing so by GUID or using the propertybags array method? |
|
|||
|
Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Quote:
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Ok. That explains why. I am using the propertybags method and so the issue with the Library must be limited just to that. I know it isn't with the data since the application didn't crash when i don't use the library for addblockedrecordings and instead go directly to the webservice. Since you know the library, is there an easy way to debug the library webservice calls to see how/why it would be causing issues?
|
|
|||
|
Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Actually, the ByGuids method was added in BTV 4.8.2, but I didn't actually update the library for those extra methods, so I am using addblockedrecordings like you...
I double checked the code, all looks fine for it.
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Ok. I will double check my code. I just can't figure out why it has worked up until 4.9.
|
|
|||
|
Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Quote:
__________________
BTV 4.9.2 | XP Pro SP2 (nLite'd)| PVR-250/500/Firewire | Videotron - Pace 551 HD | Hitachi 50V500 (DVI) BeyondTVLibrary: BTV 4.9 SDK addition for developers. wiki BTV-Negociator 5.07: Conflict resolution/Guide updates/Searches/etc. wiki BTV-Externinator 1.70: External recordings, Firewire/clear QAM/DVB/R5000HD/etc. wiki GrafCorder: Record from a simple .GRF file. wiki MLBeyond TV: MainLobby integration. |
|
|||
|
Re: Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)
Its reproducible and i have rebooted these machines and it hasn't helped. It happens on all three installs of mine.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Beyond TV SDK addition for developers | DaWanderer | Development Discussion | 35 | 02-21-2009 11:55 AM |
| The perfect addition to the extreme HTPC | MarcP | SnapStream Discussion | 10 | 09-22-2006 09:37 AM |
| Nice addition | Terminal | Beyond TV and Beyond TV Link User-to-User Troubleshooting & Support Forum | 2 | 10-09-2003 09:01 AM |