Create recordings for epg events via htsp, problem if epg data changes
Added by Jan Hendrik Schulz over 8 years ago
Hi,
I try to write a little (python) tool that automatically creates recordings for epg events, similar to the autorec feature, but with some additional restrictions.
The tool searches the epg events via htsp method 'epgQuery'. For every matching event with no 'dvrId' it creates a new recording via htsp method 'addDvrEntry', using the eventId of the epg event. I do it this way, because I thought, if the epg data will change later (like modified start/stop times) the recording will be adjusted accordingly.
Unfortunately, during my tests, if the epg data changes the existing epg event and recording isn't updated, but a new epg event with a new eventId is created. My tool than creates a new recording for this new event, as it has no drvId yet. As a result I get two recordings with only slightly different start/stop times, for the old and the new eventId...
What can I do to prevent this?
My tvheadend version: 4.0.8
Replies (2)
RE: Create recordings for epg events via htsp, problem if epg data changes - Added by Ulrich Buck over 8 years ago
I guess you could extend your little (python) tool to recognise the duplicate/overlapping/outdated recording and to delete it using 'cancelDvrEntry' and 'deleteDvrEntry'.
RE: Create recordings for epg events via htsp, problem if epg data changes - Added by Jan Hendrik Schulz over 8 years ago
Yes, that's what I did now. I added a "clean up" step that removes the old recordings, as a workaround for this problem.
But I still wonder why this happens at all. It's possible to create a recording for an event or with channel, start and stop time. If I create a recording for an event, using the eventId, I tell tvheadend to record this event. If the event changes (like modified start time) I would expect that tvheadend changes the recording as well. But instead a new event with a new eventId is created and the recording still uses the old event with the old data. That makes no sense to me...