Merging recording rules

For discussion related to MythTV which doesn't belong in another forum.

Moderator: Forum Moderators

Post Reply
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Merging recording rules

Post by majenko »

A number of channels (UK, DVB-T) have recently started doing something really really annoying with films. They play half the film, then dump in a stupid "movie news" or "celebrity gossip" segment (something which no one ever wants to watch), then play the second half of the film. Each of these they schedule as individual programs.

At the moment I am selecting the two individual movie segments for recording then manually transcoding and joining the two recordings into one file afterwards. Which is kind of ok, but sometimes it misses the start of the second program (I already have a start-early set, and I don't really want to increase that more than necessary).

I *could* manually create a custom recording rule that records the whole film and the "news" segment in the middle as one single recording, but doing that for every film I want to watch is a complete pain in the ass.

What would be far better would be if there were an option to select two recordings on the same channel and have them converted into a custom recording rule automatically. The earliest start time to the latest end time.

Code: Select all

[Recording 1] -- space -- [Recording 2]
to:
[  -----  Whole  recording   -----    ]
Is there any facility (script, plugin, whatever) that can do such a thing? I don't mind running scripts from the terminal (Linux), and I already have a few that I use for other purposes that I wrote myself. So if there is nothing I could resort to writing my own, but I'd rather not waste my time if there is already something that can do it for me.
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

My initial experiments of editing the database to manually merge rules (copy the enddate and endtime from the second recording to the first and deleting the second recording) seem to be failing. It still only recorded the first hour of the film. It would help if someone had a link to (or could describe) how the recordings work from the perspective of the database...
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Merging recording rules

Post by bill6502 »

I'd suggest the Services API rather than direct DB work. Dvr/UpdateRecordSchedule
may help. https://www.mythtv.org/wiki/DVR_Service ... rdSchedule discusses it.
You get the record schedule as a template and then modify that and update it.

If you speak Python, I can post an example that changes rule data.
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

I am not familiar with the API, but shouldn't be too hard to learn.

I don't like python. PHP and Perl are my chosen scripting languages...
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

I don't see anything in the API for modifying a recording schedule, only getting, deleting, enabling, etc.
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

Ah, WiKi is out of date. I see UpdateRecordiSchedule in the WSDL spec...
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Merging recording rules

Post by bill6502 »

You're right, and I didn't write that one, but agree that GetRecordSchedule is the
proper one to look at. The recommended method is to Get the schedule and then
modify the parameters for use by Update. Note that you could create a special
template for the annoying films, maybe with an extended record time etc. Then
Get the template and modify it for a specific film.

I don't speak Perl, but this was written by a Perl user: https://www.mythtv.org/wiki/Services_API_with_PERL
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

So is there anything else I need to change other than the end time in the recording schedule? That and delete the second recording' of course? Is there any link between the schedule and the program list that could override the end time in the schedule? Cus that's the only thing I could think of that would explain why the DB manipulation didn't have any effect. The frontend showed the right times in the rule, but it just didn't honour them.
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

Actually, one idea that just occurred to me: instead of changing the end time I could add the difference between the two end times to the post record extension time. That way it wouldn't matter if there were some link getting in the way. It would just be the first program with a massive extension of an hour or so.
majenko
Newcomer
Posts: 8
Joined: Tue Apr 03, 2018 12:10 pm
Great Britain

Re: Merging recording rules

Post by majenko »

Hmmm... It seems the changes I made last night to my little direct-db-manipulation script may have fixed the issue. The changes I made were to:
  • Set "search" to 5
  • Clear the program ID URI
It recorded an entire film, and set the subtitle to be the recording start time.

So I think I may leave it at that for now and see how it goes.
Post Reply