[mythtv] [patch] buglet when using recording groups

Dave Alden alden at math.ohio-state.edu
Thu Feb 19 20:38:03 EST 2004


Hi,
  I'd started using the Recording Groups (quite extensively), but myth
wasn't saving the new recordings into the group I specified, it was
always saving it into "Default".  After poking around a bit I believe
I've found the problem -- when a new record is inserted into the
recorded table, 'recgroup' is missing, so mysql inserts the default
value "Default".  I've attached a patch.  :-)
...dave
-------------- next part --------------
Index: libs/libmythtv/programinfo.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.cpp,v
retrieving revision 1.114
diff -u -r1.114 programinfo.cpp
--- libs/libmythtv/programinfo.cpp	16 Feb 2004 06:43:43 -0000	1.114
+++ libs/libmythtv/programinfo.cpp	20 Feb 2004 01:21:29 -0000
@@ -889,19 +889,21 @@
     QString sqlsubtitle = subtitle;
     QString sqldescription = description;
     QString sqlcategory = category;
+    QString sqlrecgroup = recgroup;
 
     sqltitle.replace(QRegExp("\""), QString("\\\""));
     sqlsubtitle.replace(QRegExp("\""), QString("\\\""));
     sqldescription.replace(QRegExp("\""), QString("\\\""));
     sqlcategory.replace(QRegExp("\""), QString("\\\""));
+    sqlrecgroup.replace(QRegExp("\""), QString("\\\""));
 
     QString query;
     query = QString("INSERT INTO recorded (chanid,starttime,endtime,title,"
-                    "subtitle,description,hostname,category,autoexpire,recordid) "
-                    "VALUES(%1,\"%2\",\"%3\",\"%4\",\"%5\",\"%6\",\"%7\",\"%8\"")
+                    "subtitle,description,hostname,category,recgroup,autoexpire,recordid) "
+                    "VALUES(%1,\"%2\",\"%3\",\"%4\",\"%5\",\"%6\",\"%7\",\"%8\",\"%9\"")
                     .arg(chanid).arg(starts).arg(ends).arg(sqltitle.utf8()) 
                     .arg(sqlsubtitle.utf8()).arg(sqldescription.utf8())
-                    .arg(gContext->GetHostName()).arg(sqlcategory.utf8());
+                    .arg(gContext->GetHostName()).arg(sqlcategory.utf8()).arg(sqlrecgroup.utf8());
     query += QString(",%1,%2);")
                     .arg(record->GetAutoExpire()).arg(recordid);
 


More information about the mythtv-dev mailing list