summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael T. Dean <mdean@mythtv.org>2011-06-13 16:33:20 (GMT)
committer Michael T. Dean <mdean@mythtv.org>2011-06-13 16:33:20 (GMT)
commitf37917f9476aadf33f2eb35df5d423700a438c33 (patch)
treea5dc2b63257fdf99a62d6c4eb9bb2b652920b917
parentd27bedf5571bdb80c164ce5d11a8af55f0275b92 (diff)
Use settings code to store mythfilldatabase HaveRepeats.
Modify mythfilldatabase to use the main settings code to store the HaveRepeats setting data. This will prevent scheduling issues that can occur when users/scripts/packages/whatever break the MythTV settings table data through direct DB editing or invalid partial database restore procedures, or when users have extremely bad luck and that one particular row is corrupted in the database binary data files and "fixed" by mysqlcheck/REPAIR table by deleting the row.
-rw-r--r--mythtv/programs/mythfilldatabase/main.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/mythtv/programs/mythfilldatabase/main.cpp b/mythtv/programs/mythfilldatabase/main.cpp
index 3f61ae6..c0258e1 100644
--- a/mythtv/programs/mythfilldatabase/main.cpp
+++ b/mythtv/programs/mythfilldatabase/main.cpp
@@ -676,19 +676,9 @@ int main(int argc, char *argv[])
if (query.exec() && query.next())
{
if (query.value(0).toInt() != 0)
- {
- query.prepare("UPDATE settings SET data = '1' "
- "WHERE value = 'HaveRepeats';");
- if (!query.exec())
- MythDB::DBError("Setting HaveRepeats", query);
- }
+ gCoreContext->SaveSettingOnHost("HaveRepeats", "1", NULL);
else
- {
- query.prepare("UPDATE settings SET data = '0' "
- "WHERE value = 'HaveRepeats';");
- if (!query.exec())
- MythDB::DBError("Clearing HaveRepeats", query);
- }
+ gCoreContext->SaveSettingOnHost("HaveRepeats", "0", NULL);
}
}