How do I reschedule a failed recording NOW on a different tuner?

Post Reply
dborn
Junior
Posts: 22
Joined: Tue Aug 29, 2017 9:21 pm
Canada

How do I reschedule a failed recording NOW on a different tuner?

Post by dborn »

Hi all,

I've been wanting to do this for a long time and now with the new "Recording Failing" System Event and the Services API, I figured it should be easy enough.

My perl script (using the Perl API example module 'scan_database') works pretty well and is able to start a new recording of a running show when called from the command line given a fictitious "failed recording" cardid and channelid, if no recording rule already existed. If I actually program a recording and wait for it to start, then issue a "reschedule on a different tuner" using my script, the rule gets created but it doesn't actually start the new recording. Even manually stopping the recording from the frontend and then calling my script will not get a second, new recording going.

Is it possible to do what I want? and if so, how should I proceed?

A bit of background info:
My current setup is V29.1 latest on a linux combined be/fe (I also have 3 other fe's but that's irrelevant here)
I have one tuner using an hdpvr connected to an HD set top box
I also have an HVR2250 dual tuner card connected to an antenna getting ATSC channels.
Some channels are available from both sources and I get the occasional failed recording from the hdpvr. What usually happens is that I miss the show due to that. If I have a free ATSC tuner playing the same show, I could start recording from there, even if I miss the first few seconds and still get to watch my show later.

Now if the API allowed doing a raw record specifying the tuner, channel, start (now) and stop times, I could also achieve what I want but unless I missed it, this is not currently possible.

If anybody knows of a way to do this, I'd be real interested in finding out. So far all my attempts have fallen short of the objective.

Thanks in advance,
Daniel Born
dborn
Junior
Posts: 22
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by dborn »

One important detail I should add:

To schedule the new recording, I first perform a GetRecordSchedule and then change the following parameters before issuing an AddRecordSchedule:
Type = "Single Record"
Station = CallSign from the existing schedule (API naming inconsistency)
PreferredInput = a different, free cardid than the one that failed (that is also playing the desired show)
MaxEpisodes = 0
MaxNewest = false
Description = "Rescheduled failed recording"

I tried setting ParentId to the current schedule's Id field but this returned an error.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by bill6502 »

Hi,

Try Dvr/ReactivateRecording?RecordedId=<the failed recording's recordedid>

%RECOEDRDID% was added to UserJobs/Events in June 2018. I haven't
tried to see if it's available for a failed recording though.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by bill6502 »

Look at the SQL, or just to backend:6544/Dvr/GetRecordSchedule?RecordId=<the reactivated rid>
be able to use AddRecordSchedule to switch the input. On my
test, the type is Override Recording, ParentID is set, e.g. to the 'real'
rule.
dborn
Junior
Posts: 22
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by dborn »

Hi Bill, thanks for responding,

When doing a Dvr/GetRecordSchedule, the <Id> number returned, is that the same thing as the RecordId?

Doing a Dvr/ReactivateRecording on a failed recording, will that automatically chose a different tuner if free and also having the same showing? or will it try again on the same tuner? (same channels use different <ChannelId>s on the different sources). I set the same channels CallSign data to be the same on the different tuners.

In your second post, you mention using <Type>= 'Override Recording' and <ParentId> set to the failed recording's <Id>. Could I also set my preferred tuner? I guess I will try it and find out for myself :)

Thanks,
Daniel
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by bill6502 »

Turns out that ReactivteRecording just sets the reactivate column in the oldrecorded table
and then pokes the scheduler. No recording rule changes. It has no affect on the tuners
used. I'm going to see if changing the recording rule's tuner selection 1st and then
reactivating works.

I'm in the try in myself mode too. I'd been using:
localhost:6544/Dvr/GetRecordSchedule?ChanId=1071&StartTime=2018-11-05T01:00:00&MakeOverride=True
to develop the template. Then altering the parameters as you did. It's not working for me.
User avatar
bill6502
Developer
Posts: 2323
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by bill6502 »

Easier than I thought. I didn't have a failed recording, just one that I started and
stopped after a minute. Then I used some tools I've got and changed the
recording rule's PreferredInput of 0 to 32. Reactivated the RecordedId and
checked the tuner in use (it was my 2nd HDHR's tuner, which is 32.) Then
restored the PreferredInput to 0.

Not elegant, but it worked and could easily be put in a Perl (or my choice Python)
program.

Code: Select all

update_recording_rule.py --host=mc0 --parameter=PreferredInput --value=32 --rules '^The Alec Baldwin Show$' --wrmi
api --host=mc0 --endpoint=Dvr/ReactivateRecording --postdata RecordedId=13651 --wrmi
update_recording_rule.py --host=mc0 --parameter=PreferredInput --value=0 --rules '^The Alec Baldwin Show$' --wrmi
dborn
Junior
Posts: 22
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: How do I reschedule a failed recording NOW on a different tuner?

Post by dborn »

Awesome! Thanks Bill, I will try that. I'm always a little worried when playing around in the database, even if I have a recent backup. This MythTV system is in high use and the WAF would go way down if I render it non-functional for any amount of time (conversely, failed recordings when other tuners could take over is also not super good for the WAF!) ;)

As long as it works and doesn't break anything, elegant comes in second.

Cheers,
Daniel
P.S. Yesterday I had a real failed recording while I was looking at it. From the frontend, I just chose "Reactivate this recording" and it started properly back up that time on that same "failed" tuner, with a couple of minutes missing from the start. This is probably option #1 to try and if it fails a second time, then try a different tuner, if available... Just to make matters more interesting.
Post Reply