Results 1 to 8 of 8

Thread: Helper functions and objects

  1. #1
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,543

    Helper functions and objects

    In troubleshooting this problem http://forums.gbpvr.com/showthread.p...876#post431876 I was wondering what happens when a plugin isn't updated when structures change? The EPG objects changed quite a bit in 2.3.6 but how does NextPVR keep in sync with an outdated TVListings for scheduling using the API?

    Martin

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,590
    I'm careful to never change existing methods or behaviour, but instead only add new new additonal methods and attributes, so it should be fully backward compatible. ie, In this case, none of the methods to get those EPG objects have changed, but the EPG objects returned have additional attributes that aren't yet being used by TVListings.

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,543
    Thanks, that's good to know. So if fields like Genres, UniqueID aren't being populated that would be your problem?

    Martin

  4. #4
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,590
    The app wouldn't care if those fields aren't populated.

  5. #5
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,543
    So, I am still a little confused. If I understand correctly if the old code calls

    ScheduleHelperFactory.GetScheduleHelper().Schedule Recording(epgEvent, RecordingQuality.QUALITY_BEST);

    using an old style epgEvent you will use old and new fields to schedule the event, carrying across what you can. I noticed sometimes FirstRun was true, is that the constructor? Are the fields in the source epgEvent.OID record in EPG_EVENT used at all?

    Martin

  6. #6
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,590
    When that call is made, some of the basic attributes of the epgEvent are used, like the channel, the title, the start time and the end time. The app doesnt care about other informational attributes like genre etc. It does however call epgEvent.ToString() to serialize the event and it's attributes to xml for storing a copy of with the recording. If some attributes like Genre etc weren't set, then they wont be in the xml, and will ultimately be missing when the recording is later displayed in the Recordings screen (meaning the skin wouldn't be able to show this information).

    If TV Listings was using the supplied APIs for loading the EPG events, then it should already contain all the new attributes. They'd only be missing if he'd rolled his only routines which were bypassing the built in api and querying directly from the database (and not knowing to look for these new fields).

    As long as the basic attributes are present, then it shouldn't cause any issues.

  7. #7
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,543
    From what you have written it sounds like the plugin doesn't really need to care about the changes in the API unless of course a name or calling logic changes.

    To test this I loaded the other user's database cancelled Lost Girl and rescheduled it and got this which is what I expect

    Code:
    <Event>
      <OID>18371725</OID>
      <Title>Lost Girl</Title>
      <SubTitle>Food for Thought</SubTitle>
      <Description>Lauren tends to a sick Aswang; Dyson&apos;s relationship with Kenzi becomes stronger.</Description>
      <ChannelOID>7663</ChannelOID>
      <StartTime>2012-02-23T07:00:00.0000000Z</StartTime>
      <EndTime>2012-02-23T08:01:00.0000000Z</EndTime>
      <FirstRun>false</FirstRun>
      <OriginalAirDate>2010-10-24T00:00:00.0000000</OriginalAirDate>
      <Season>1</Season>
      <Episode>6</Episode>
      <Rating>TV-MA</Rating>
      <Audio>stereo</Audio>
      <Aspect>16:9</Aspect>
      <Quality>HDTV</Quality>
      <Genres>
        <Genre>Action/Adventure</Genre>
        <Genre>Drama</Genre>
        <Genre>Episodic</Genre>
        <Genre>Series</Genre>
      </Genres>
      <UniqueID>EP01304253.0006</UniqueID>
    </Event>
    instead of

    Code:
    <Event>
      <OID>18371725</OID>
      <Title>Lost Girl</Title>
      <SubTitle>Food for Thought</SubTitle>
      <Description>Lauren tends to a sick Aswang; Dyson&apos;s relationship with Kenzi becomes stronger.</Description>
      <ChannelOID>7663</ChannelOID>
      <StartTime>2012-02-23T07:00:00.0000000Z</StartTime>
      <EndTime>2012-02-23T08:01:00.0000000Z</EndTime>
      <FirstRun>true</FirstRun>
      <Season>1</Season>
      <Episode>6</Episode>
      <Rating>TV-MA</Rating>
    </Event>
    Can I assume this is because alibert not loading the EPGEvent with the API and not because he is hasn't rebuilt the plugin with the new functions?

    Martin

  8. #8
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,590
    Quote Originally Posted by mvallevand View Post
    Can I assume this is because alibert not loading the EPGEvent with the API and not because he is hasn't rebuilt the plugin with the new functions?
    Yes, I think that is the most likely cause.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •