diff -Naur mythtv-rel/libs/libmythtv/channelsettings.cpp mythtv/libs/libmythtv/channelsettings.cpp --- mythtv-rel/libs/libmythtv/channelsettings.cpp 2006-01-17 11:22:59.000000000 -0800 +++ mythtv/libs/libmythtv/channelsettings.cpp 2006-02-12 09:58:51.000000000 -0800 @@ -21,6 +21,19 @@ }; }; +class TimeOffset: public LineEditSetting, public CSetting { +public: + TimeOffset(const ChannelID& id): + LineEditSetting(), CSetting(id, "tmoffset") { + setLabel(QObject::tr("Time Offset")); + setHelpText(QObject::tr("Offset (in seconds) to apply to the program " + "guide data in listings. This can be used " + "when the listings for a particular channel " + "are in a different time zone. (Works for " + "DataDirect listings only.)")); + }; +}; + class Channum: public LineEditSetting, public CSetting { public: Channum(const ChannelID& id): @@ -284,6 +297,7 @@ connect(source,SIGNAL(valueChanged(const QString&)),this,SLOT(sourceChanged(const QString&))); #else addChild(new XmltvID(id)); + addChild(new TimeOffset(id)); #endif }; diff -Naur mythtv-rel/libs/libmythtv/dbcheck.cpp mythtv/libs/libmythtv/dbcheck.cpp --- mythtv-rel/libs/libmythtv/dbcheck.cpp 2006-02-10 20:44:57.000000000 -0800 +++ mythtv/libs/libmythtv/dbcheck.cpp 2006-02-12 09:58:51.000000000 -0800 @@ -10,7 +10,7 @@ #include "mythdbcon.h" /// This is the DB schema version expected by the running MythTV instance. -const QString currentDatabaseVersion = "1123"; +const QString currentDatabaseVersion = "1124"; static bool UpdateDBVersionNumber(const QString &newnumber); static bool performActualUpdate(const QString updates[], QString version, @@ -241,6 +241,11 @@ The 'xmltvid' field is used to identify this channel to the listings provider. +The 'tmoffset' field is used to apply an offset (in seconds) from the listings +provided by the provider to a new time in the MythTV program guide database. +This is very handy when the listings provider has listings which are offset +by a few hours on individual channels with the rest of them being correct. + The 'recpriority' field is used tell the scheduler from which of two otherwise equivalent programs on two different channels should be prefered, a higher number means this channel is more preferred. @@ -2006,6 +2011,17 @@ return false; } + if (dbver == "1123") + { + const QString updates[] = { +"ALTER TABLE channel ADD COLUMN tmoffset INT NOT NULL default '0';", +"" +}; + + if (!performActualUpdate(updates, "1124", dbver)) + return false; + } + // Drop xvmc_buffer_settings table in 0.20 // Drop dvb_dmx_buf_size and dvb_pkt_buf_size columns of channel in 0.20 diff -Naur mythtv-rel/programs/mythfilldatabase/filldata.cpp mythtv/programs/mythfilldatabase/filldata.cpp --- mythtv-rel/programs/mythfilldatabase/filldata.cpp 2006-02-07 13:53:46.000000000 -0800 +++ mythtv/programs/mythfilldatabase/filldata.cpp 2006-02-12 09:58:52.000000000 -0800 @@ -988,7 +988,9 @@ "hdtv, closecaptioned, partnumber, parttotal, seriesid, " "originalairdate, colorcode, syndicatedepisodenumber, " "programid) " - "SELECT chanid, starttime, endtime, " + "SELECT chanid," + "DATE_ADD(starttime, INTERVAL (SELECT tmoffset from channel where dd_v_program.chanid = channel.chanid) SECOND), " + "DATE_ADD(endtime, INTERVAL (SELECT tmoffset from channel where dd_v_program.chanid = channel.chanid) SECOND), " "title, subtitle, description, " "showtype, dd_genre.class, category_type, " "airdate, stars, previouslyshown, stereo, subtitled, "