rendered paste bodyIndex: programs/mythfilldatabase/filldata.cpp
===================================================================
--- programs/mythfilldatabase/filldata.cpp (revision 13751)
+++ programs/mythfilldatabase/filldata.cpp (working copy)
@@ -264,7 +264,8 @@
QString home = QDir::homeDirPath();
QString configfile = QString("%1/%2.xmltv").arg(MythContext::GetConfDir())
.arg(source.name);
-
+ QString cachefile = QString("%1/%2.cache").arg(MythContext::GetConfDir())
+ .arg(source.name);
QString command = QString("nice %1 --config-file '%2' --output %3")
.arg(xmltv_grabber.ascii())
.arg(configfile.ascii())
@@ -564,7 +565,43 @@
.arg(xmltv_grabber));
}
}
+ if ((*it).xmltvgrabber_cache)
+ {
+ QString cachefile = QString("%1/%2_cache.conf")
+ .arg(MythContext::GetConfDir())
+ .arg((*it).name);
+ QFile file(cachefile);
+ if (!file.exists())
+ {
+ QString cachedir = QString("%1/%2_cache")
+ .arg(MythContext::GetConfDir())
+ .arg((*it).name);
+
+ if (file.open(IO_WriteOnly))
+ {
+ QTextStream stream(&file);
+ stream << "BasePath " << cachedir << "\n";
+ stream << "Verbose 1" << "\n";
+ file.close();
+ }
+ else
+ {
+ VERBOSE(VB_IMPORTANT, QString("Creating cache config, "
+ "%1, failed.").arg(cachedir));
+ (*it).xmltvgrabber_cache = false;
+ }
+
+ QDir dir(cachedir);
+ if (!dir.exists() && !dir.mkdir(dir.path()))
+ {
+ VERBOSE(VB_IMPORTANT, QString("Creating cache directory, "
+ "%1, failed.").arg(cachedir));
+ (*it).xmltvgrabber_cache = false;
+ }
+ }
+ }
+
need_post_grab_proc |= (xmltv_grabber != "datadirect");
if ((xmltv_grabber == "datadirect") && dd_grab_all)