Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: NextPVR web API for scheduling - DayMask

  1. #1
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170

    NextPVR web API for scheduling - DayMask and Timeslot

    Sub looking at pvr.nextpvr code I was wondering if there was also an "Any Day" dayMask I could use with &day_mask= that Kodi doesn't enable? NUtility does have one.

    Code:
    std::string cPVRClientNextPVR::GetDayString(int dayMask)
    {
      std::string days;
      if (dayMask == (PVR_WEEKDAY_SATURDAY | PVR_WEEKDAY_SUNDAY))
      {
        days = "WEEKENDS";
      }
      else if (dayMask == (PVR_WEEKDAY_MONDAY | PVR_WEEKDAY_TUESDAY | PVR_WEEKDAY_WEDNESDAY | PVR_WEEKDAY_THURSDAY | PVR_WEEKDAY_FRIDAY))
      {
        days = "WEEKDAYS";
      }
      else
      {
        if (dayMask & PVR_WEEKDAY_SATURDAY)
          days += "SAT:";
        if (dayMask & PVR_WEEKDAY_SUNDAY)
          days += "SUN:";
        if (dayMask & PVR_WEEKDAY_MONDAY)
          days += "MON:";
        if (dayMask & PVR_WEEKDAY_TUESDAY)
          days += "TUE:";
        if (dayMask & PVR_WEEKDAY_WEDNESDAY)
          days += "WED:";
        if (dayMask & PVR_WEEKDAY_THURSDAY)
          days += "THU:";
        if (dayMask & PVR_WEEKDAY_FRIDAY)
          days += "FRI:";
      }
    
      return days;
    }
    Also how to I indicate a Timeslot recording just add the start and end timestamps?

    Thanks.

    Martin
    Last edited by mvallevand; 2019-05-31 at 08:17 PM.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    If you don't pass in a &day_mask= parameter, it'll assume any day. Alternatively you'd need to pass &day_mask=SAT|SUN|MON|TUE|WED|THU|FRI

    You can pass in &timeslot=true, though if you're using &recurring_type, these have a fixed definition of whether timeslot is enabled:

    case 1: // Record Season (NEW episodes on this channel)

    case 2: // Record Season (All episodes on this channel)
    ...
    case 3: // Record Season (Daily, this timeslot)
    ...
    case 4: // Record Season (Weekly, this timeslot)
    ...
    case 5: // Record Season (Monday-Friday, this timeslot)
    ...
    case 6: // Record Season (Weekends, this timeslot)
    ...

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170
    Emby doesn't use any of those timeslots standard but x-newa does so that will make my life a little easier.

    Is that a pipe or semi-colon like Kodi uses?

    Also for the All Channel scheduling with &keyword= logic, do you respect <RecurringMatchExact> in config.xml?

    Martin

  4. #4
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Quote Originally Posted by mvallevand View Post
    Is that a pipe or semi-colon like Kodi uses?
    Yeah, go with semi-colon.

    Also for the All Channel scheduling with &keyword= logic, do you respect <RecurringMatchExact> in config.xml?
    Yes, I think so.

  5. #5
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170
    Quote Originally Posted by sub View Post
    You can pass in &timesslot=true, though if you're using &recurring_type, these have a fixed definition of whether timeslot is enabled:
    With these options do I need start and end time?

    Martin

  6. #6
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    Its been quite a while since I've looked at this, but I'm pretty sure it calculates the timeslot from the start time of the original event used to create the recurring recording (&event_id=), and defaults to finding shows that start with +/- 90 minutes of that original time (but prefers that exact same start time if there is show with that time)

  7. #7
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170
    Thanks, everything seems to be working as expected and it quite logical now that I understand. One thing Kodi does for All Channels All Episodes, is allow a timeslot and fakes a keyword search. I like the looks a the NextPVR created All Channels recurring record better because it is clearer to me looking at the list. Is there a type for that and does it allow a start and end date?

    Martin
    Attached Images Attached Images  

  8. #8
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170
    I am bumping this thread with some additional info. It looks like the are both type 7

    Code:
    2019-06-03 15:40:27.539 T:13620   DEBUG: {u'name': u'Coronation Street', u'enabled': True, u'postPadding': 2, u'channelID': 0, u'prePadding': 1, u'period': u'KEYWORD: Coronation Street', u'keep': 0, u'advancedRules': u'KEYWORD: Coronation Street', u'type': 7, u'id': 448, u'channel': u'All Channels'}
    
    2019-06-03 15:40:27.539 T:13620   DEBUG: {u'name': u'Rizzoli & Isles', u'enabled': True, u'postPadding': 2, u'channelID': 0, u'prePadding': 1, u'period': u'All Episodes', u'keep': 0, u'advancedRules': u"title like 'Rizzoli & Isles'", u'type': 7, u'id': 449, u'channel': u'All Channels'}
    What I'd like to be able to do from the API is create that second type of All Channels recording. I am finding additional issues with the Keyword search because it seems to schedule things not just based on the Title I tried Monk and I had 100's of recordings.

    Martin

  9. #9
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,204
    That 'all episodes' 'all channels', as shown above on Paw Patrol is really a special case to make it look nicer. It does it when it's an advanced recording, with the query title like 'name'. You could probably pass in that instead of a keyword to get the same behaviour.

  10. #10
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,170
    The API parameter I know for this requires &keyword=... and when I tried adding that query I get

    <AdvancedRules>KEYWORD: title like'Man With a Plan'</AdvancedRules>

    Edit if I manually remove the 'KEYWORD: ' from the database it does display like NextPVR. Perhaps you could not prepend "KEYWORD: " if the parameter starts with "title like '"

    Martin
    Last edited by mvallevand; 2019-06-04 at 12:40 AM.

Posting Permissions

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