Creating manual recording with API, dupmethod and searchtype wrong

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
wmorrison
Senior
Posts: 143
Joined: Sat Dec 01, 2018 12:05 am
United States of America

Creating manual recording with API, dupmethod and searchtype wrong

Post by wmorrison » Thu Apr 15, 2021 10:46 pm

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.

User avatar
pgbennett
Developer
Posts: 404
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

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

Post by pgbennett » Fri Apr 16, 2021 1:26 pm

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

wmorrison
Senior
Posts: 143
Joined: Sat Dec 01, 2018 12:05 am
United States of America

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

Post by wmorrison » Fri Apr 16, 2021 4:51 pm

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.

Post Reply