Page 1 of 1

Creating manual recording with API, dupmethod and searchtype wrong

Posted: Thu Apr 15, 2021 10:46 pm
by wmorrison
I'm creating manual recording rules with Dvr/AddRecordSchedule. It works, but dupmethod and searchtype are not getting set to values I specified.

Should they be integers, or strings? I've tried both, and it doesn't work either way. Trying to set dupmethod 1 searchtype 5 to mimic a manual rule set up with frontend. When I create with the api, it always coumes out dupmethod 6 searchtype 0.

Re: Creating manual recording with API, dupmethod and searchtype wrong

Posted: Fri Apr 16, 2021 1:26 pm
by pgbennett
The APIS do not take the numeric code values. They take strings that are translated to the numbers.

Dupmethod must be one of these
none
subtitle
description
subtitle and description
subtitleanddescription
subtitle then description
subtitlethendescription

If it is none of those the default is applied, which is subtitle and description
see https://github.com/MythTV/mythtv/blob/3 ... s.cpp#L293
Similarly for all selections that translate to numbers.
For searchtype see https://github.com/MythTV/mythtv/blob/3 ... s.cpp#L329

I don't know if these are documented anywhere, I find them by looking in the code. Start at https://github.com/MythTV/mythtv/blob/m ... es/dvr.cpp

Re: Creating manual recording with API, dupmethod and searchtype wrong

Posted: Fri Apr 16, 2021 4:51 pm
by wmorrison
Thanks. Got it working.

Have a python script fired when a recording starts. It looks back a few hours in the schedule on chanid and checks if any sports was on. If there was, it automatically schedules an "overtime" recording for an hour after the show.

I know I can modify individual rules to record late, but it's a pain because I have to remember to do it for any new rule that might have sports before it (usually Sunday evening but sometimes mid-week.)

I absolutely HATE losing the end of shows because sports ran into overtime. I'm like the opposite of the "Heidi Bowl" complainers, cut off that sports show and start my show on schedule! Not gonna happen, I know.