Ticket #713: perchandiff.txt

File perchandiff.txt, 3.8 KB (added by Joe Votour <joevph@…>, 20 years ago)

Patch against MythTV 0.19-release

Line 
1diff -Naur mythtv-rel/libs/libmythtv/channelsettings.cpp mythtv/libs/libmythtv/channelsettings.cpp
2--- mythtv-rel/libs/libmythtv/channelsettings.cpp 2006-01-17 11:22:59.000000000 -0800
3+++ mythtv/libs/libmythtv/channelsettings.cpp 2006-02-12 09:58:51.000000000 -0800
4@@ -21,6 +21,19 @@
5 };
6 };
7
8+class TimeOffset: public LineEditSetting, public CSetting {
9+public:
10+ TimeOffset(const ChannelID& id):
11+ LineEditSetting(), CSetting(id, "tmoffset") {
12+ setLabel(QObject::tr("Time Offset"));
13+ setHelpText(QObject::tr("Offset (in seconds) to apply to the program "
14+ "guide data in listings. This can be used "
15+ "when the listings for a particular channel "
16+ "are in a different time zone. (Works for "
17+ "DataDirect listings only.)"));
18+ };
19+};
20+
21 class Channum: public LineEditSetting, public CSetting {
22 public:
23 Channum(const ChannelID& id):
24@@ -284,6 +297,7 @@
25 connect(source,SIGNAL(valueChanged(const QString&)),this,SLOT(sourceChanged(const QString&)));
26 #else
27 addChild(new XmltvID(id));
28+ addChild(new TimeOffset(id));
29 #endif
30 };
31
32diff -Naur mythtv-rel/libs/libmythtv/dbcheck.cpp mythtv/libs/libmythtv/dbcheck.cpp
33--- mythtv-rel/libs/libmythtv/dbcheck.cpp 2006-02-10 20:44:57.000000000 -0800
34+++ mythtv/libs/libmythtv/dbcheck.cpp 2006-02-12 09:58:51.000000000 -0800
35@@ -10,7 +10,7 @@
36 #include "mythdbcon.h"
37
38 /// This is the DB schema version expected by the running MythTV instance.
39-const QString currentDatabaseVersion = "1123";
40+const QString currentDatabaseVersion = "1124";
41
42 static bool UpdateDBVersionNumber(const QString &newnumber);
43 static bool performActualUpdate(const QString updates[], QString version,
44@@ -241,6 +241,11 @@
45 The 'xmltvid' field is used to identify this channel to the listings
46 provider.
47
48+The 'tmoffset' field is used to apply an offset (in seconds) from the listings
49+provided by the provider to a new time in the MythTV program guide database.
50+This is very handy when the listings provider has listings which are offset
51+by a few hours on individual channels with the rest of them being correct.
52+
53 The 'recpriority' field is used tell the scheduler from which of two
54 otherwise equivalent programs on two different channels should be
55 prefered, a higher number means this channel is more preferred.
56@@ -2006,6 +2011,17 @@
57 return false;
58 }
59
60+ if (dbver == "1123")
61+ {
62+ const QString updates[] = {
63+"ALTER TABLE channel ADD COLUMN tmoffset INT NOT NULL default '0';",
64+""
65+};
66+
67+ if (!performActualUpdate(updates, "1124", dbver))
68+ return false;
69+ }
70+
71 // Drop xvmc_buffer_settings table in 0.20
72 // Drop dvb_dmx_buf_size and dvb_pkt_buf_size columns of channel in 0.20
73
74diff -Naur mythtv-rel/programs/mythfilldatabase/filldata.cpp mythtv/programs/mythfilldatabase/filldata.cpp
75--- mythtv-rel/programs/mythfilldatabase/filldata.cpp 2006-02-07 13:53:46.000000000 -0800
76+++ mythtv/programs/mythfilldatabase/filldata.cpp 2006-02-12 09:58:52.000000000 -0800
77@@ -988,7 +988,9 @@
78 "hdtv, closecaptioned, partnumber, parttotal, seriesid, "
79 "originalairdate, colorcode, syndicatedepisodenumber, "
80 "programid) "
81- "SELECT chanid, starttime, endtime, "
82+ "SELECT chanid,"
83+ "DATE_ADD(starttime, INTERVAL (SELECT tmoffset from channel where dd_v_program.chanid = channel.chanid) SECOND), "
84+ "DATE_ADD(endtime, INTERVAL (SELECT tmoffset from channel where dd_v_program.chanid = channel.chanid) SECOND), "
85 "title, subtitle, description, "
86 "showtype, dd_genre.class, category_type, "
87 "airdate, stars, previouslyshown, stereo, subtitled, "