2013-01-04, 15:42
During generating a new timer, applying default rule setting from backend does not work (mythtv 0.26)
Reason: Some field names has been changed in table "settings" and/or hostname isn't NULL.
Referring to here http://www.mythtv.org/wiki/Settings_table,
"AutoTranscode" changed to "JobAllowTranscode" ,
"AutoRunUserJob1" changed to "JobAllowUserJob1",
"AutoRunUserJob2" changed to "JobAllowUserJob2",
"AutoRunUserJob3" changed to "JobAllowUserJob3",
"AutoRunUserJob4" changed to "JobAllowUserJob4" and
"AutoCommercialFlag" changed to "JobAllowCommFlag"
and Hostname isn't NULL
I already made some changes to see if it is working:
Perhaps, providing "JobAllowMetadata" could be a good idea
Reason: Some field names has been changed in table "settings" and/or hostname isn't NULL.
Referring to here http://www.mythtv.org/wiki/Settings_table,
"AutoTranscode" changed to "JobAllowTranscode" ,
"AutoRunUserJob1" changed to "JobAllowUserJob1",
"AutoRunUserJob2" changed to "JobAllowUserJob2",
"AutoRunUserJob3" changed to "JobAllowUserJob3",
"AutoRunUserJob4" changed to "JobAllowUserJob4" and
"AutoCommercialFlag" changed to "JobAllowCommFlag"
and Hostname isn't NULL
I already made some changes to see if it is working:
Code:
--- addons/pvr.mythtv.cmyth/src/pvrclient-mythtv.cpp-orig 2012-12-22 17:56:29.000000000 +0100
+++ addons/pvr.mythtv.cmyth/src/pvrclient-mythtv.cpp 2013-01-04 00:48:55.369146675 +0100
@@ -1023,12 +1024,12 @@
PVRtoMythRecordingRule(timer, rule);
// Apply default rule setting from backend
- rule.SetAutoTranscode(atoi(m_db.GetSetting("AutoTranscode").c_str()) > 0);
- rule.SetUserJob(1, atoi(m_db.GetSetting("AutoRunUserJob1").c_str()) > 0);
- rule.SetUserJob(2, atoi(m_db.GetSetting("AutoRunUserJob2").c_str()) > 0);
- rule.SetUserJob(3, atoi(m_db.GetSetting("AutoRunUserJob3").c_str()) > 0);
- rule.SetUserJob(4, atoi(m_db.GetSetting("AutoRunUserJob4").c_str()) > 0);
- rule.SetAutoCommFlag(atoi(m_db.GetSetting("AutoCommercialFlag").c_str()) > 0);
+ rule.SetAutoTranscode(atoi(m_db.GetSetting("JobAllowTranscode").c_str()) > 0);
+ rule.SetUserJob(1, atoi(m_db.GetSetting("JobAllowUserJob1").c_str()) > 0);
+ rule.SetUserJob(2, atoi(m_db.GetSetting("JobAllowUserJob2").c_str()) > 0);
+ rule.SetUserJob(3, atoi(m_db.GetSetting("JobAllowUserJob3").c_str()) > 0);
+ rule.SetUserJob(4, atoi(m_db.GetSetting("JobAllowUserJob4").c_str()) > 0);
+ rule.SetAutoCommFlag(atoi(m_db.GetSetting("JobAllowCommFlag").c_str()) > 0);
rule.SetAutoExpire(atoi(m_db.GetSetting("AutoExpireDefault").c_str()) > 0);
rule.SetTranscoder(atoi(m_db.GetSetting("DefaultTranscoder").c_str()));
if (rule.Category() == m_db.GetSetting("OverTimeCategory"))
--- lib/cmyth/libcmyth/mythtv_mysql.c-orig 2012-12-22 17:56:29.388571838 +0100
+++ lib/cmyth/libcmyth/mythtv_mysql.c 2013-01-04 00:48:50.007190763 +0100
@@ -1996,7 +1996,8 @@
{
MYSQL_RES *res = NULL;
MYSQL_ROW row;
- const char *query_str = "SELECT data FROM settings WHERE value = ? AND hostname IS NULL;";
+ //const char *query_str = "SELECT data FROM settings WHERE value = ? AND hostname IS NULL;";
+ const char *query_str = "SELECT data FROM settings WHERE value = ?;";
int rows = 0;
cmyth_mysql_query_t * query;
@@ -2019,6 +2020,8 @@
rows++;
}
+ cmyth_dbg(CMYTH_DBG_DEBUG, "%s, setting %s, result %s, rows %d\n", __FUNCTION__, setting, *data, rows);
+
mysql_free_result(res);
return rows;
}
Perhaps, providing "JobAllowMetadata" could be a good idea