Opened 14 years ago

Closed 13 years ago

#713 closed patch (fixed)

Per-channel offset for DataDirect listings

Reported by: Joe Votour <joevph@…> Owned by: cpinkham
Priority: minor Milestone: 0.20
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

As stated in my original post on the mythtv-users list http://www.gossamer-threads.com/lists/mythtv/users/159850?search_string=per-channel;#159850), The folks at Zap2It have my program information messed up on some channels. The short of it: I need to offset the guide data on about 10-15 channels by three hours in order to have correct listings for scheduling recordings.

Attached to this ticket is a patch that allows for this for DataDirect? listings - it includes the necessary MySQL changes in filldata.cpp, and also includes code to make the user-defined offset (default 0 for no change) in the Channel Editor in mythtv-setup.

Three things about this patch:

  1. There is no support for XMLTV-based grabbers. I have been unable to get data to import for them, and thus cannot even begin to start making the necessary changes. If somebody could assist me with this, I would appreciate it. I suspect that the change would work in the same manner as the DataDirect? method (DATE_ADD in the MySQL query), but can't be 100% sure.
  2. Since program information is loaded and inserted in the database during the initial DataDirect? download (when fetching the channel listings), if any channels have their time offset changed, then the contents of the "program" table must be deleted, otherwise the changes won't take effect until the guide data runs out
  3. When using the offset, there will be a gap in the listings for the first day, relative to how far you shift the offset. This is to be expected since you're moving the data out of the expected window.

This patch is against SVN HEAD as of 2005-11-25, 20:00ish (PST), version 8041.

-- Joe

Attachments (6)

perchanneloffs.diff (5.3 KB) - added by anonymous 14 years ago.
perchantimes.diff (3.8 KB) - added by Joe Votour <joevph@…> 14 years ago.
Updated patch to SVN 8465
perchandiff.txt (3.8 KB) - added by Joe Votour <joevph@…> 13 years ago.
Patch against MythTV 0.19-release
perchandiff9163.diff (3.9 KB) - added by Joe Votour <joevph@…> 13 years ago.
Patch against MythTV SVN9163
perchanneloffset_cp_v1.diff (4.4 KB) - added by cpinkham 13 years ago.
Patch against SVN v9270 with changes described in my message from 5 minutes ago.
perchanneloffset_jv_v1.diff (9.8 KB) - added by Joe Votour <joevph@…> 13 years ago.
Patch against SVN9270 with changes by cpinkham

Download all attachments as: .zip

Change History (18)

comment:1 Changed 14 years ago by Joe Votour <joevph@…>

Keywords: jdonavan removed
Owner: changed from Isaac Richards to jdonavan

Stupid me... Entered in the appropriate developer's name in the wrong field...

Changed 14 years ago by anonymous

Attachment: perchanneloffs.diff added

comment:2 Changed 14 years ago by Joe Votour <joevph@…>

Milestone: 0.19
Severity: mediumlow
Type: defectenhancement
Version: head

I have not heard anything about this patch since it has been submitted (two weeks now) I'm guessing I didn't fill out the properties correctly, so here's a second go at it.

More of a follow-up than anything.

-- Joe

Changed 14 years ago by Joe Votour <joevph@…>

Attachment: perchantimes.diff added

Updated patch to SVN 8465

comment:3 Changed 14 years ago by anonymous

Type: enhancementpatch

Updated the patch to SVN 8465 (2006-01-01).

Caveats from initial message in ticket still apply.

-- Joe

comment:4 Changed 14 years ago by Joe Votour <joevph@…>

Owner: jdonavan deleted

comment:5 Changed 13 years ago by danielk

Milestone: 0.190.20
Owner: set to Isaac Richards

comment:6 Changed 13 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham

comment:7 Changed 13 years ago by Joe Votour <joevph@…>

Chris,

After 0.19 has been released, I will make another patch suitable for inclusion in 0.20 SVN.

At the same time, if you have any suggestions to make this work with XMLTV grabbers (I suspect I can use the same MySQL construct to adjust the time on non-DataDirect? data, I was just never able to get XMLTV grabbers working to test), I'm all ears.

-- Joe

Changed 13 years ago by Joe Votour <joevph@…>

Attachment: perchandiff.txt added

Patch against MythTV 0.19-release

Changed 13 years ago by Joe Votour <joevph@…>

Attachment: perchandiff9163.diff added

Patch against MythTV SVN9163

comment:8 Changed 13 years ago by Joe Votour <joevph@…>

Added a patch against SVN9163 - I had to wipe my machine because I messed it up, so I figured I'd compile the latest SVN.

I know that patience is a virtue, but please, could this get committed (or at least an explanation of why it won't be/what needs to be changed)? I've been running this patch now for three months, and it's working for me.

Thanks, Joe

comment:9 Changed 13 years ago by cpinkham

Status: newassigned

comment:10 Changed 13 years ago by cpinkham

I merged this into my tree, made a few tweaks, and then realized that it is missing a couple major pieces. The attached patch does not handle keeping the various program* tables such as programrating in sync with the adjusted times that are inserted. You also are not using the tmoffset amount when the data is cleared from the database, meaning that at the end of the day, you could be clearing data for a 24-hour period that is on an even day boundary, but when you reinsert data, it may not start/end on that 24-hour boundary because of the tmoffset, so you could have incomplete data around midnight. In order for this to be committed to SVN, you need to handle the tmoffset on the various program* table inserts as well as the deletes that are in clearDataByChannel() in filldata.cpp. I also don't think that we need the precision down to one second on the tmoffset value, so I changed this to 1 minute and use a spinbox instead of a lineedit in order to do validity checking on the tmoffset value. I also had to change your insert statement to not use a sub-select, but to instead join against the channel table. I think the sub-select fails on older MySQL revisions which we are still trying to support. If you want to correct the insert/delete issues above and resubmit, then I'll take another look. Also, to save time, if you want to start with my merged copy of the source, that will help get this committed quicker since I won't have to correct the issues I describe above that I fixed while merging into my copy of SVN. I'll attach the merged patch from my tree so you'll have that to work with. If I have to remake the second -> minute and sub-select changes in order to merge this in again, it will take longer for me to get it into SVN unfortunately.

Changed 13 years ago by cpinkham

Attachment: perchanneloffset_cp_v1.diff added

Patch against SVN v9270 with changes described in my message from 5 minutes ago.

Changed 13 years ago by Joe Votour <joevph@…>

Attachment: perchanneloffset_jv_v1.diff added

Patch against SVN9270 with changes by cpinkham

comment:11 Changed 13 years ago by Joe Votour <joevph@…>

Chris,

Taking your attached patch, I went through the source code and made the suggested changes. It compiled, mythfilldatabase ran, and my scheduled recordings looked correct, but I can't be totally sure that the other tables really did get updated correctly. The SQL looks right, but I'm not a master SQL crafter.

-- Joe

comment:12 Changed 13 years ago by cpinkham

Resolution: fixed
Status: assignedclosed

(In [9430]) Add a new "time offset" setting for DataDirect? channels to allow you to offset the guide data for a particular channel such as when one or more channels are received from a different time zone. This only affects data imported from DataDirect? sources, if someone wants to write and test the code to implement this for xmltv grabbers, that would be nice. This DataDirect?-only patch by Joe Votour. Closes #713.

Note: See TracTickets for help on using tickets.