[mythtv] mythfilldatabase patch for german 'tv_grab_de'
Ben Bucksch
linux.news at bucksch.org
Tue May 6 00:13:42 EDT 2003
avalanche at beyondmonkey.com wrote:
>there where still some problems with mythfilldatabase
>and german xmltv. Channel names that had spaces
>where not recognized correctly. This patch should fix that.
>(scroll down for more info)
>
Yes, I had the same problem and also created a patch for it. I posted it
some time a go, but didn't have time to make a special testing setup to
test the de and na grabber.
Attached.
See also <http://www.bucksch.org/1/projects/various/xmltv/>, which
contains a better grabber for German listings, with more info and no
spaces in the IDs.
Ben Bucksch
-------------- next part --------------
Index: programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/cvs/MC/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.53
diff -u -r1.53 filldata.cpp
--- programs/mythfilldatabase/filldata.cpp 19 Apr 2003 04:56:46 -0000 1.53
+++ programs/mythfilldatabase/filldata.cpp 19 Apr 2003 13:25:21 -0000
@@ -30,6 +30,7 @@
bool quiet = false;
bool no_delete = false;
bool isgist = false;
+bool isNorthAmerica = false; // XXX global vars are ugly
MythContext *gContext;
@@ -176,7 +177,7 @@
QString xmltvid = element.attribute("id", "");
QStringList split = QStringList::split(" ", xmltvid);
- if (!isgist)
+ if (isNorthAmerica)
{
chaninfo->xmltvid = split[0];
chaninfo->chanstr = split[0];
@@ -187,8 +188,8 @@
}
else
{
- chaninfo->callsign = "";
- chaninfo->chanstr = "";
+ chaninfo->callsign = ""; // use xmltvid?
+ chaninfo->chanstr = ""; // use xmltvid?
chaninfo->xmltvid = xmltvid;
}
@@ -362,10 +363,14 @@
pginfo->endts = et;
- text = element.attribute("channel", "");
- split = QStringList::split(" ", text);
-
- pginfo->channel = split[0];
+ if (isNorthAmerica)
+ {
+ text = element.attribute("channel", "");
+ split = QStringList::split(" ", text);
+ pginfo->channel = split[0];
+ }
+ else
+ pginfo->channel = element.attribute("channel", "");
pginfo->start = fromXMLTVDate(pginfo->startts);
pginfo->end = fromXMLTVDate(pginfo->endts);
@@ -1106,6 +1119,8 @@
command.sprintf("nice -19 %s --days 7 --config-file %s --output %s",
xmltv_grabber.ascii(), configfile.ascii(),
filename.ascii());
+ else if (xmltv_grabber == "tv_grab_na")
+ isNorthAmerica = true;
else if (xmltv_grabber == "tv_grab_nz")
command.sprintf("nice -19 %s -n 1 -f %d -o %s",
xmltv_grabber.ascii(), offset,
More information about the mythtv-dev
mailing list