SnapStream Forums

Go Back   SnapStream Forums > SnapStream Developer Network > Development Discussion
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-21-2008, 10:38 AM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
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).
Attached Files
File Type: zip BeyondTVLibrary_4.81-v2.zip (28.1 KB, 167 views)
File Type: zip BeyondTVLibrary_4.81-v2_src.zip (328.9 KB, 191 views)
File Type: zip BeyondTVLibrary_4.9-v3.zip (31.3 KB, 38 views)
File Type: zip BeyondTVLibrary_4.9-v3_src.zip (335.1 KB, 66 views)
__________________
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.
Reply With Quote
  #2 (permalink)  
Old 04-26-2008, 10:38 AM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
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.
Reply With Quote
  #3 (permalink)  
Old 09-22-2008, 11:54 AM
Registered User
 
Join Date: Nov 2007
Posts: 28
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
Reply With Quote
  #4 (permalink)  
Old 09-22-2008, 01:13 PM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
Thumbs up Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by bitpusher View Post
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.
Maybe Kilrsat can chime in, but I am not aware of any property bags with actual duplicates, instead the values would be comma delimited (i.e. Genre, Actors, etc.) As far as I know, they were simply an artificial construct of daWanderer for the developer's benefit... As noted, you can still use bagHelper.Add(PVSProperty) if you want to bypass this behavior...

Quote:
If you do not agree I will be branching BTVLibrary as I DO want to know EXACTLY what the service is returning.
You probably don't need to go through that much trouble, instead of using:

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.
Reply With Quote
  #5 (permalink)  
Old 09-23-2008, 09:06 AM
Administrator
 
Join Date: Dec 2004
Location: Houston, TX
Posts: 2,289
Send a message via AIM to Kilrsat
Re: Beyond TV SDK addition for developers (BTV >= 4.8)

There won't be duplicate property names coming from any of the webservices.
Reply With Quote
  #6 (permalink)  
Old 09-26-2008, 11:20 PM
Registered User
 
Join Date: Nov 2007
Posts: 28
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.
Reply With Quote
  #7 (permalink)  
Old 12-10-2008, 06:30 PM
Registered User
 
Join Date: Apr 2008
Posts: 19
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)
I have confirmed it is not my code. I have connected my application directly to the BTV webservice and everything works fine (only modification on my part was to change the object calls to point to the web reference instead of the BTVLibrary reference). I took a look at the BTVLibrary code but cannot seem to find the issue in the Library that is causing the problem. Anyone else running into this issue?
Reply With Quote
  #8 (permalink)  
Old 12-10-2008, 06:57 PM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Delta_5 View Post
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:
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.
Reply With Quote
  #9 (permalink)  
Old 12-10-2008, 08:32 PM
Registered User
 
Join Date: Apr 2008
Posts: 19
Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Fonceur View Post
I just blocked a recording in BTV-Negociator without any issue... Are you sure that it's not the ticket that had expired?
No. I originally thought that was it but i output the auth ticket just before it crashes and i was able to use it through IE when navigating to the webservices. This application is one that runs as a scheduled task and ends well before the 15 minute ticket time out. I get the crash after about 30 seconds into the application running (it does some processing and SQL queries first).

In your program, when you block a recording, are you doing so by GUID or using the propertybags array method?
Reply With Quote
  #10 (permalink)  
Old 12-10-2008, 08:54 PM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Delta_5 View Post
In your program, when you block a recording, are you doing so by GUID or using the propertybags array method?
Right, I do use the GUID, as the propertybags is more capricious...
__________________
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.
Reply With Quote
  #11 (permalink)  
Old 12-10-2008, 09:00 PM
Registered User
 
Join Date: Apr 2008
Posts: 19
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?
Reply With Quote
  #12 (permalink)  
Old 12-10-2008, 09:22 PM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Delta_5 View Post
Ok. That explains why.
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.
Reply With Quote
  #13 (permalink)  
Old 12-14-2008, 11:26 PM
Registered User
 
Join Date: Apr 2008
Posts: 19
Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Fonceur View Post
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.
Ok. I will double check my code. I just can't figure out why it has worked up until 4.9.
Reply With Quote
  #14 (permalink)  
Old 12-15-2008, 12:01 AM
Problem solver
 
Join Date: Jan 2004
Location: Montreal, Qc
Posts: 4,907
Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Delta_5 View Post
Ok. I will double check my code. I just can't figure out why it has worked up until 4.9.
Was it only once or is it reproducible? From time to time, BTV services have been known to crash, and a reboot clears thing up...
__________________
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.
Reply With Quote
  #15 (permalink)  
Old 12-15-2008, 12:06 AM
Registered User
 
Join Date: Apr 2008
Posts: 19
Re: Re : Re: Re : Re: Beyond TV SDK addition for developers (BTV >= 4.8)

Quote:
Originally Posted by Fonceur View Post
Was it only once or is it reproducible? From time to time, BTV services have been known to crash, and a reboot clears thing up...
Its reproducible and i have rebooted these machines and it hasn't helped. It happens on all three installs of mine.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -6. The time now is 06:46 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0 RC1
©2004-2006 Snapstream Media