[mythtv] Support for tv_grab_se (Patch)
Martin Forssen
maf at tkrat.org
Wed Nov 17 22:23:19 UTC 2004
The attached patch does the following:
* Adds support for tv_grab_se and tv_grab_no and removes support for
tv_grab_sn. This is done to track changes made by xmltv upstream.
* Removes the old configuration file before running tv_grab_*. If this
is not done tv_grab_se will ask a question on stdout if it should
overwrite the configuration file.
* Prepend "yes |" to the tv_grab_* command when executing. This was done
so that any questions tv_grab_* asks on the console are answered
automatically.
/MaF
-------------- next part --------------
Index: libs/libmythtv/videosource.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videosource.cpp,v
retrieving revision 1.51
diff -u -r1.51 videosource.cpp
--- libs/libmythtv/videosource.cpp 5 Aug 2004 20:59:30 -0000 1.51
+++ libs/libmythtv/videosource.cpp 17 Nov 2004 11:46:50 -0000
@@ -341,7 +341,8 @@
QString filename = QString("%1/.mythtv/%2.xmltv")
.arg(QDir::homeDirPath()).arg(parent.getSourceName());
- command = QString("%1 --config-file '%2' --configure")
+ unlink(filename);
+ command = QString("yes|%1 --config-file '%2' --configure")
.arg(grabber).arg(filename);
}
@@ -363,9 +364,10 @@
"information"));
}
- if (grabber == "tv_grab_de" || grabber == "tv_grab_sn" ||
+ if (grabber == "tv_grab_de" || grabber == "tv_grab_se" ||
grabber == "tv_grab_fi" || grabber == "tv_grab_es" ||
- grabber == "tv_grab_nl" || grabber == "tv_grab_jp")
+ grabber == "tv_grab_nl" || grabber == "tv_grab_jp" ||
+ grabber == "tv_grab_no")
{
cerr << "You _MUST_ run 'mythfilldatabase --manual the first time, "
<< "instead\n";
@@ -404,8 +406,11 @@
addTarget("tv_grab_de", new XMLTV_generic_config(parent, "tv_grab_de"));
grabber->addSelection("Germany/Austria", "tv_grab_de");
- addTarget("tv_grab_sn", new XMLTV_generic_config(parent, "tv_grab_sn"));
- grabber->addSelection("Sweden/Norway","tv_grab_sn");
+ addTarget("tv_grab_se", new XMLTV_generic_config(parent, "tv_grab_se"));
+ grabber->addSelection("Sweden","tv_grab_se");
+
+ addTarget("tv_grab_no", new XMLTV_generic_config(parent, "tv_grab_no"));
+ grabber->addSelection("Norway","tv_grab_no");
addTarget("tv_grab_uk", new XMLTV_generic_config(parent, "tv_grab_uk"));
grabber->addSelection("United Kingdom","tv_grab_uk");
Index: programs/mythfilldatabase/filldata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfilldatabase/filldata.cpp,v
retrieving revision 1.135
diff -u -r1.135 filldata.cpp
--- programs/mythfilldatabase/filldata.cpp 13 Nov 2004 23:02:40 -0000 1.135
+++ programs/mythfilldatabase/filldata.cpp 17 Nov 2004 11:46:52 -0000
@@ -2340,7 +2340,11 @@
filename.ascii());
isJapan = true;
}
- else if (xmltv_grabber == "tv_grab_sn")
+ else if (xmltv_grabber == "tv_grab_se")
+ command.sprintf("nice %s --days 1 --offset %d --config-file '%s' --output %s",
+ xmltv_grabber.ascii(), offset, configfile.ascii(),
+ filename.ascii());
+ else if (xmltv_grabber == "tv_grab_no")
command.sprintf("nice %s --days 1 --offset %d --config-file '%s' --output %s",
xmltv_grabber.ascii(), offset, configfile.ascii(),
filename.ascii());
@@ -2363,7 +2367,8 @@
xmltv_grabber == "tv_grab_fi" ||
xmltv_grabber == "tv_grab_es" ||
xmltv_grabber == "tv_grab_nz" ||
- xmltv_grabber == "tv_grab_sn" ||
+ xmltv_grabber == "tv_grab_se" ||
+ xmltv_grabber == "tv_grab_no" ||
xmltv_grabber == "tv_grab_dk" ||
xmltv_grabber == "tv_grab_uk" ||
xmltv_grabber == "tv_grab_uk_rt" ||
@@ -2546,9 +2551,11 @@
else if (xmltv_grabber == "datadirect" ||
//xmltv_grabber == "tv_grab_na" ||
xmltv_grabber == "tv_grab_uk_rt" ||
- xmltv_grabber == "tv_grab_sn")
+ xmltv_grabber == "tv_grab_se" ||
+ xmltv_grabber == "tv_grab_no")
{
- if (xmltv_grabber == "tv_grab_sn")
+ if (xmltv_grabber == "tv_grab_se" ||
+ xmltv_grabber == "tv_grab_no")
listing_wrap_offset = 6 * 3600;
QDate qCurrentDate = QDate::currentDate();
@@ -2579,7 +2586,8 @@
int maxday = 9;
if (xmltv_grabber == "tv_grab_uk_rt" ||
- xmltv_grabber == "tv_grab_sn")
+ xmltv_grabber == "tv_grab_se" ||
+ xmltv_grabber == "tv_grab_no")
maxday = 14;
if (xmltv_grabber == "datadirect")
maxday = 14;
More information about the mythtv-dev
mailing list